Groups | Blog | Home
all groups > flash (macromedia) > july 2005 >

flash (macromedia) : Flash 5 ActionScript


David Stiller
7/10/2005 8:07:04 PM
ceivia,

[quoted text, click to view]

When you're stuck with ActionScript, it's always a good idea to take a
quick glance at the ActionScript Language Reference; in this case, the
ifFrameLoaded entry. Note that this function has been available since Flash
3 (that's aeons ago, in Flash years) and was deprecated in Flash 5 in favor
of MovieClip._framesloaded, which allows you to add custom if()/else
statements.

[quoted text, click to view]

Here's your code ...

// Frame 5
stop ();
ifFrameLoaded (28) {
nextFrame ();
}

.... now let's step through the logic. Let's say this SWF is loading for the
very first time one someone's computer. SWFs progressively download, which
means the user is probably seeing frames 1, 2, 3, and so on before the rest
of them load. Now let's say frame 5 is showing.

Aha! ActionScript! Let's see what is does: first, stop. Okay,
stopped. Now, if frame 28 is loaded, go to the next frame. Ah. Well, is
frame 28 loaded? ... It isn't yet? Okay. I'm done.

And that's it. There's nothing involved here that makes the SWF check
frame 28 but one time -- and the first time it does, frame 28 probably isn't
loaded.

You might consider dropping the stop() action altogether. Start with
the ifFrameLoaded(), and folow that line immediately with prevFrame(). This
will send the playhead back to frame 4, and almost immediately back to frame
5, where it will check again if frame 28 is loaded ... and it will continue
in this loop until the answer is, "Yes, 28 is loaded."

Of course, you should *really* replace ifFrameLoaded() altogether, per
the Language Reference. But I'll leave that up to you. ;)


David
stiller (at) quip (dot) net
Tackling the ActionScript Language Reference
http://www.quip.net/tutorials/

ceivia
7/10/2005 10:16:54 PM
YO PEEPULS...

I am trying desperately to get a very simple Flash 5 ActionScript to work. I
am building a website for a photographer friend of mine, and i am trying to
control the way the page loads with an IfFrameIsLoaded command. I have uploaded
an image to help you see what i am talking about. In a nutshell, i put the
ActionScript command on Frame 5, and i do not want the player to play Frame 6
(the Next Frame) until Frame 23 is Loaded. I have tried creating Labels and
about five days' worth of other possibilities, but am still at a loss....

This is a very simple script but i just cannot figure it out!!

Here is the website:
http://www.momentumcarrier.com/index1.html
click on PORTFOLIOS when you get there, and then on the Top-Left mouseover to
open up the loaded swf file.

And here is a shot of the code:
www.momentumcarrier.com/action1.htm


thx,

+E
cei@ceivia.com

AddThis Social Bookmark Button