So I have been trying to find an answer for this several hours this morning and last night. Thanks in advance. I have been trying to open a local folder by clicking a button and I am not getting the actionscript right. Because getURL is outdated I guess in AS3. But every other bit of my script is AS3 so I can't just use AS2.
Could anyone give me a solution to this?
Also, I already used the URLRequest method. Ended up opening "C:/..." in my web browser which as you can see, is not what I am trying to do.
You need to make an Air App, then you will have access to NativeProcess (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcess.html)
With NativeProcess class you can call windows explorer.
ndm suggestion code's :
var f : File = new File("c:");
f.openWithDefaultApplication();
Related
I have been developing a Web type Flex project in Flash builder. In this project I have been trying to load a swf file using the SWFLoader. I have had trouble getting the debugger working, so I have instead created an identical Air project that I can run and debug with (I keep it up to date with a script). I have successfully loaded the swf file in my Air project with no trouble. But, when I went to test this in my Web project, the SWFLoader does not seem to work, I just get a blank area where my SWFLoader element should display the loaded swf file.
private function get_swf_file_binary_amf(event:ResultEvent):void {
Alert.show("SWF Returned");
var decoder:Base64Decoder=new Base64Decoder();
decoder.decode(event.result);
var swf_bytes:ByteArray=decoder.toByteArray();
var context:LoaderContext=new LoaderContext();
context.allowLoadBytesCodeExecution=true;
context.parameters = {myval: "test_string"};
swf_loaded_file.loaderContext = context;
swf_loaded_file.addEventListener(Event.COMPLETE, loadComplete);
swf_loaded_file.load(swf_bytes);
}
private function loadComplete(completeEvent:Event):void{
trace("load Complete")
}
Above is the code that works in my Adobe Air project. I am receiving the binary data of my swf file and converting it into a ByteArray, not using the URLLoader like so many example suggest. Could this be the cause of my problems when I try to run this in my Web project?
Edit/Update: I have found the particular line where the Web project fails:
context.allowLoadBytesCodeExecution=true;
I am still not sure why my Web project does not like this line, yet my Air project doesn't care.
I have removed the accursed line:
context.allowLoadBytesCodeExecution=true;
This seems to have fixed the problem. I am not even quite sure what this line does, I had just carried it over from a tutorial. Getting rid of it didn't seem to break anything that worked in my Air project, so I think that solved my problem.
I'm trying to load the swf created by 'flip book maker' into my project.
the files created by flipbook maker are
book.swf
framework.swf
I used the following code
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("book.swf");
myLoader.load(url);
addChild(myLoader);``
the framework.swf is linked with book.swf, so it cannot run alone.
When I run the movie it shows the Error #2032, Stream error to framework.swf
book.swf and framework.swf both are in the same directory.They are generated by flip book maker What I needed is to load the book.swf into my project at a particular frame. I need help in AS3 for this purpose.
How to fix it..?
please help me..!
Error #2032 means that your Flash application could not load the framework.swf for some reason (you know this already of course). What you need to find out is why. Possible reasons are: you have the wrong URL, the framework.swf is not in the place you expect, there are crossdomain restrictions on the file you are trying to access ( you did not state where frameworks.swf).
What I would suggest doing is using a web debugging proxy tool like Fiddler (http://www.telerik.com/fiddler) or Firebug (is a Firefox extension) and take a look at the http requests to get more information on your error. You may find out that frameworks.swf is not in the location you expect.
This is just a IOError event triggered by Adobe Flash. Most likely the file just isn't found. Check your path and make sure you place the .swf file in your bin-debug directory if you're doing this from within Adobe Flash Builder
Does anyone think it could be possible to create a custom debugger for swf files using a socket, able to support breaking points and step through code functionality?
I know there are swf debugger's out there but I have not found one that can step through code...
I was thinking of creating one and would like to get some input and ideas.
I know flash has a System.Pause() function that will stop the player and I can get the code line using stackTrace. but I have no idea how to perform the step functionality.
Maybe FlasCC some how?
Or create a server debugger which will call the pause function every step... but how would I know when a new line is being processed?
The reason I would like to create this is to debug Flash extension SWFpanel which wont connect to flash remote debugger
Any thoughts and ideas are welcome .
I am writing a little test program, and I have a problem regarding the ActionScript 3 Facebook API (Graph_API_Web_1_8_1.swc).
I am using FlashDevelop, and I correctly added the SWC file to the "lib" folder.
I also imported the Facebook API correctly in my class file (the auto-finish function of FD recognizes all code from there).
BUT, once I start compiling my code, I get the following error:
Error: Access of undefined property Facebook
for each line of code, that includes a Facebook call (such as Facebook.init(...), Facebook.login(...) and Facebook.logout(...)).
I added a screenshot of my FlashDevelop setup to clarify things:
This is even more mysterious to me, since the AIR application with the FacebookDesktop API is running without any errors.
How do I fix this problem?
This has happened to me several times. Don't waste your time looking into which ActionScript 3 SDK SWC version or Flex SDK you are using. It's just a weird bug. Instead, do the following.
Close FlashDevelop
Create a completely new project
Add the Facebook SWC to library
Then it should work. If not, reboot. It happened to me several times. I hope this helps.
Keeping into consideration the Actionscript 3 event HTTPStatusEvent:HTTP_RESPONSE_STATUS, which is ONLY AVAILABLE for AIR (and not Flash 9/10)
Quote from site:
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Lite 4
I would like to add the same EVENT by extending the HTTPStatusEvent Class of Actionscript 3 for Flash (9/10).
I'm working on Adobe Flash CS3 and I'm trying to get the "last" location of a URL loader (I'm calling a php with a header("Location: ..."); ) so I need the location after it changes. This should be made directly by flash and I cannot use php proxies not other.
Also, I cannot find the source code of the AIR HTTPStatusEvent Class, which I need to get the event (specifically, the responseHeaders and responseURL properties that the AIR class has).
Of course, if you know of any other way to accomplish this, feel free to share it.
You can't do it this way.
Think about it: You are trying to add behavior to the URLLoader class by extending an event class that is thrown from there. Figuratively speaking, it's a bit like changing the paper size when you've only written letters to your next door neighbor, and now you want them to go overseas - unless you also give them to the mail main, that's not going to be very successful...
I've stumbled across a number of forum threads discussing this, and most of them seem to agree that Adobe prevented access to response headers in Flash versions prior to FP10 / AIR due to some sort of security issue. I'm not sure how much of this information is accurate, but I am quite confident that there is no way to get around this - you can't get the Location:header in older Flash versions.
You will have to find some other workaround. For example, if you have access to the PHP script, you could add an HTML comment containing the redirect location, and parse that value in ActionScript.
<!-- Location: http://google.com/ -->