| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jun 2006
Posts: 11
|
I am loading an swf into an swfLoader dynamically. When the content has been loaded I need to be able to make the loaded content move to the second frame - gotoAndStop(2).
I have tried just about everything i can think of to do this but to no avail. Can anybody help me out there? |
|
|
|
|
|
#2 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
Code:
mySWFLoader.content.gotoAndStop( 2 ); you'll need to make sure the external file has fully loaded before you invoked that method on it though. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2006
Posts: 11
|
Yeah i tried that but I get this error
"Error: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display Seems daft that there doesn't seem to be any instruction in the language reference about controlling the swf that gets loaded into the swfloader component. |
|
|
|
|
|
#4 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
ya just need to cast it to MovieClip. DisplayObjects can be/extend Sprite and therefore they don't have a timeline or gotoAndStop() methods.
Code:
var myMovieClip:MovieClip = MovieClip(mySWFLoader.content); myMovieClip.gotoAndStop( 2 ); |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jun 2006
Posts: 11
|
Ok thanks for the help
I know get a run time error of "Coercion failed: cannot convert flash.display::AVM1Movie@f6cf2f1 to flash.display.MovieClip." any thoughts? thanks again |
|
|
|
|
|
#6 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
hmmmm
is the external SWF Flash 9? I would expect it to work fine if it is, although if it aint I guess its trying to cast it to a Flash 9 MovieClip which fails cos and previous incarnation of MovieClilp doesn't have the same structure. |
|
|
|
|
|
#7 |
|
Registered User
Join Date: Jun 2006
Posts: 11
|
That would make sense.
The SWF's that are being loaded must be in Flash 8/7 for our live application to use them. The flex application is a tool to be able to administrate the swf 's for the live app. Is there any way that it is possible to cast the movieclip to flash 9 movieclip? Thanks yet again for your help. |
|
|
|
|
|
#8 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
This is a long shot, but try casting to the special type *, which basically untypes your object
Code:
var myMovieClip:* = *(mySWFLoader.content); myMovieClip.gotoAndStop( 2 ); |
|
|
|
|
|
#9 |
|
Member
|
i'm not sure, but i think that only way of communicating between AVM1 Movies and AVM2 Movies is via LocalConnection
|
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jun 2006
Posts: 11
|
Ok thanks for all your help and advice. Will have a look at localconnection today and then i'll report back with my findings.
Thanks again |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FLV Keeps Looping After Calling gotoAndStop() | crees | ActionScript 2.0 | 1 | 08-22-2005 05:53 AM |
| Problems with gotoAndStop() | Rebel7284 | ActionScript 2.0 | 1 | 07-09-2005 04:11 AM |
| loadmvie then gotoandstop | PabloPicasso | ActionScript 2.0 | 3 | 06-26-2005 01:29 PM |
| gotoAndStop problem | jrb | ActionScript 1.0 (and below) | 5 | 10-16-2001 10:17 PM |
| loadVariablesNum gotoAndStop | zapplets | ActionScript 1.0 (and below) | 2 | 04-04-2001 05:03 AM |