GotoAndPlay immediately after content is loaded fails


hello,
i'm trying gotoandplay in complex movieclip structure
main timeline.

the following code works perfectly:

function dosomething():void {
mc1.mc2.gotoandplay(2);
clearinterval(intervalid);
}

var intervalid:number = setinterval(dosomething, 1);

the following code _not_ work:

function dosomething():void {
mc1.mc2.gotoandplay(2);
trace(mc1.mc2._currentframe); // 2 playhead stops in
frame 2
}

dosomething();


here questions:
1. why code work when wait 1 millisecond before
calling function gotoandplay (or have wait
for, because none of attributes undefined).
2. flash player doing when loading movieclips.
3. there document describing internal work flashplayer
doing when loading clips (i.e. registering movieclips).

thanks help.

if place code posted on frame 1 , create 2 movie clips
"instance names" in code. works fine.

function dosomething():void {
mc1.mc2.gotoandplay(2);
trace(mc1.mc2._currentframe); // 2 playhead stops in
frame 2
}

dosomething();

so there must in complexity of movie
interferring. simple 2 movieclip instances
the same name, unnamed instances, or relative paths instances.
could more involved if loading external movies mc1
or mc2. in case have timing issue , need know when
external swf loaded. can @ moviecliploader class
external swf loading timing handlers.

the timer should not necessary if mcs in same movie.



--
lon hosford
www.lonhosford.com
flash, actionscript , flash media server examples:
http://flashexamples.hosfordusa.com
may many happy bits flow way!
"nilsb" <nburdin@fbawg.hs-bremen.de> wrote in message
news:c0dd4363.d2d%nburdin@fbawg.hs-bremen.de...
> hello,
> i'm trying gotoandplay in complex movieclip structure
> main timeline.
>
> following code works perfectly:
>
> function dosomething():void {
> mc1.mc2.gotoandplay(2);
> clearinterval(intervalid);
> }
>
> var intervalid:number = setinterval(dosomething, 1);
>
> following code _not_ work:
>
> function dosomething():void {
> mc1.mc2.gotoandplay(2);
> trace(mc1.mc2._currentframe); // 2 playhead stops in
> frame 2
> }
>
> dosomething();
>
>
> here questions:
> 1. why code work when wait 1 millisecond before
> calling function gotoandplay (or have wait
> for, because none of attributes undefined).
> 2. flash player doing when loading movieclips.
> 3. there document describing internal work flashplayer
> doing when loading clips (i.e. registering movieclips).
>
> help.
>




More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support