Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flex > Flex 2 & 3

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-26-2006, 11:56 AM   #1
pcbryant
Registered User
 
Join Date: Jun 2006
Posts: 11
Default SWFLoader gotoAndStop

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?
pcbryant is offline   Reply With Quote
Old 06-26-2006, 12:29 PM   #2
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

Code:
mySWFLoader.content.gotoAndStop( 2 );
should work.

you'll need to make sure the external file has fully loaded before you invoked that method on it though.
Tink is offline   Reply With Quote
Old 06-26-2006, 02:14 PM   #3
pcbryant
Registered User
 
Join Date: Jun 2006
Posts: 11
Default

Yeah i tried that but I get this error

"Error: Call to a possibly undefined method gotoAndStop through a reference with static type flash.displayisplayObject"

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.
pcbryant is offline   Reply With Quote
Old 06-26-2006, 02:32 PM   #4
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

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 );
Tink is offline   Reply With Quote
Old 06-26-2006, 03:29 PM   #5
pcbryant
Registered User
 
Join Date: Jun 2006
Posts: 11
Default

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
pcbryant is offline   Reply With Quote
Old 06-26-2006, 03:44 PM   #6
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

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.
Tink is offline   Reply With Quote
Old 06-26-2006, 05:18 PM   #7
pcbryant
Registered User
 
Join Date: Jun 2006
Posts: 11
Default

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.
pcbryant is offline   Reply With Quote
Old 06-26-2006, 05:40 PM   #8
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

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 );
Tink is offline   Reply With Quote
Old 06-27-2006, 02:01 AM   #9
nirth
Member
 
Join Date: May 2006
Posts: 46
Send a message via ICQ to nirth Send a message via AIM to nirth Send a message via MSN to nirth Send a message via Yahoo to nirth Send a message via Skype™ to nirth
Default

i'm not sure, but i think that only way of communicating between AVM1 Movies and AVM2 Movies is via LocalConnection
__________________
OrangeBlog finally in english, but really bad one
nirth is offline   Reply With Quote
Old 06-27-2006, 10:29 AM   #10
pcbryant
Registered User
 
Join Date: Jun 2006
Posts: 11
Default

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
pcbryant is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 09:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.