Tuesday, March 30, 2010

load AS2 swf into AS3 swf problem

I have a flash with AS3 and inside this swf i load in a AS2 swf.

to load swf works just fine, but the problem is when i load this i want to go to

a specific part of it, for example i want to go to frame 3 in the loaded swf.

i must control this from the AS3 swf, does someone know if this is possible?

thanks in advance

load AS2 swf into AS3 swf problem

yes, it's possible.?use the localconnection class to communicate between the two swfs.

load AS2 swf into AS3 swf problem

thanks!

if i would communicate to a loaded swf with AS3 instead is it the same?

Date: Sun, 7 Jun 2009 08:56:14 -0600

From: forums@adobe.com

To: gemstarlit@msn.com

Subject: Action Script 3 load AS2 swf into AS3 swf problem

yes, it's possible. use the localconnection class to communicate between the two swfs.

%26gt;

you can use localconnection to communicate between two as3 files, but there's no need.?it's much simpler to communicate directly use the correct path from the code's scope (or timeline) and the object you want to reference.

the loader's content property (cast as a movieclip) references the loaded swf's main timeline.

the loader's content (cast as a movieclip) references the loaded swf's main timeline.

so this means i must have my loaded swf inside a mc in main swf?

Date: Sun, 7 Jun 2009 09:14:24 -0600

From: forums@adobe.com

To: gemstarlit@msn.com

Subject: Action Script 3 load AS2 swf into AS3 swf problem

you can use localconnection to communicate between two as3 files, but there's no need. it's much simpler to communicate directly use the correct path from the code's scope (or timeline) and the object you want to reference.

the loader's content (cast as a movieclip) references the loaded swf's main timeline.

%26gt;

no.

if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:

MovieClip(ldr.content).f1(); // to call f1() in the loaded swf using code on the same timeline as ldr.

so can i do like this then to go to frame 3 in my loaded swf?

MovieClip(ldr.content).gotoAndStop(3); ?

sorry for being such an airhead

thanks for helping me out =)

Date: Sun, 7 Jun 2009 10:25:09 -0600

From: forums@adobe.com

To: gemstarlit@msn.com

Subject: Action Script 3 load AS2 swf into AS3 swf problem

no.

if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:

MovieClip(ldr.content).f1(); // to call f1() in the loaded swf

%26gt;

Its working now

but only if i put the code on a button and click the button when the swf is loaded

if i have the code in the timeline for example then i get an error #1009

is this possible to get around

thanks alot =)

Date: Sun, 7 Jun 2009 10:25:09 -0600

From: forums@adobe.com

To: gemstarlit@msn.com

Subject: Action Script 3 load AS2 swf into AS3 swf problem

no.

if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:

MovieClip(ldr.content).f1(); // to call f1() in the loaded swf

%26gt;

you can't direct a loading swf to its frame 3 UNTIL frame 3 is loaded.?so, you could use preloader code or use a listener to ensure your swf is completely loaded:

ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);

function loadCompleteF(e:Event){

MovieClip(ldr.content).gotoAndStop(3);

}

No comments:

Post a Comment