-
1. Re: Access the second frame of the loaded swf file using Adobe AIR
Ned Murphy Sep 10, 2012 5:29 AM (in response to ramviswa123)Can you show the code you use for loading the external swf and the code you tried to use to make it go to its second frame?
-
2. Re: Access the second frame of the loaded swf file using Adobe AIR
ramviswa123 Sep 10, 2012 6:42 AM (in response to Ned Murphy)I am using the following code to load the External swf file.
var swfloader:Loader=new Loader();
swfloader.load(new URLRequest("test.swf"));
addChild(swfloader);
-
3. Re: Access the second frame of the loaded swf file using Adobe AIR
sinious Sep 10, 2012 8:46 AM (in response to ramviswa123)You must wait for the Loader's Event.COMPLETE function to fire off to be sure it's fully loaded. After that access the .content property of the loader to gain access to the MovieClip inside it, e.g.:
swfloader.addEventListener(Event.COMPLETE, onComplete);
function onComplete(e:Event):void
{
var mc:MovieClip = MovieClip(e.target.content);
// go to frame 2
mc.gotoAndPlay(2);
}
-
4. Re: Access the second frame of the loaded swf file using Adobe AIR
Ned Murphy Sep 10, 2012 9:05 AM (in response to ramviswa123)What code did you try to use to make the loaded movie change frames?
-
5. Re: Access the second frame of the loaded swf file using Adobe AIR
ramviswa123 Sep 10, 2012 10:06 PM (in response to sinious)lot of thanks..
I loaded Successfully
-
6. Re: Access the second frame of the loaded swf file using Adobe AIR
ramviswa123 Sep 11, 2012 6:26 AM (in response to sinious)Sorry..,
I loaded the second frame of the external swf(Action Script 3.0 SWF) Successfully.
And
If I Load the Action Script 2.0 SWF file, it produce the ERROR.
So, How I load the Action Script 2.0 SWF file in the same AIR file.
And In that also I want to goto the Second frame.
Pls Help Me..
-
7. Re: Access the second frame of the loaded swf file using Adobe AIR
sinious Sep 11, 2012 6:35 AM (in response to ramviswa123)AS3.0 and 2.0 do not mix well. While you can load an AS2.0 SWF into a AS3.0 document you cannot execute code because the runtime can only run one version of ActionScript, 2.0 or 3.0. You should open the AS2.0 document and convert it to 3.0 and you won't have an issue.
-
8. Re: Access the second frame of the loaded swf file using Adobe AIR
ramviswa123 Sep 11, 2012 7:18 AM (in response to sinious)Mainly In Flash itself I can't get the Windows Temp Directory.
So, I use this AIR application for find the Windows Temp Directory and read one text file and execute the other swf files.
I have some are in AS2 and AS3 swf files.
So, How I solve this problem.
-
9. Re: Access the second frame of the loaded swf file using Adobe AIR
sinious Sep 11, 2012 8:19 AM (in response to ramviswa123)Do you have access to the source FLA for the AS2 documents? If so you can add some code to help you out while using a LocalConnection (example 3rd party solution, another here) to communicate between the 2 virtual machines. If HTML is used to load the separate SWF files then those SWF files could interact with JavaScript as a bridge in the same manner.
You have nothing in AS3 that can identify with the classes in AS2. If you tried casting the loaded AS2 SWF to a AS3 MovieClip class in order to use the "gotoAndPlay()" method you'll just get errors (cannot cast MovieClip to AVM1Movie, etc). AS3's AVM2 treats an AS2 SWF as that class, AVM1Movie. You can only access basic properties (x/y/width/height/etc) but you cannot invoke any code as I mentioned. Using gotoAndPlay would be invoking a function.
Here's more limits on the AVM1Movie object:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/AVM1Movie .html
-
10. Re: Access the second frame of the loaded swf file using Adobe AIR
ramviswa123 Sep 11, 2012 12:01 PM (in response to sinious)Can I able to call the loaded AS 2.0 swf function from the AS3 AIR document.?
-
11. Re: Access the second frame of the loaded swf file using Adobe AIR
ramviswa123 Sep 11, 2012 11:28 PM (in response to sinious)In AIR Action Script 3.0, use "File.userDirectory" to find the windows user directory.
so,
How I find the same user directory in AIR Action Script 2.0.
In AS 2.0, the File method can't use..
-
12. Re: Access the second frame of the loaded swf file using Adobe AIR
sinious Sep 12, 2012 5:20 AM (in response to ramviswa123)AIR is basically a project type with it's own extra libraries. You can use all the libraries from Flash but in addition to them you can get extra functionality. It does not to my knowledge support AS2.0 at all.



