Groups | Blog | Home
all groups > flash (macromedia) > march 2004 >

flash (macromedia) : one for urami .... or anyone who knows the answe


bwclan
3/23/2004 10:27:00 PM
03/23/2004 02:17:14 AM

(posted this earlier but forgotto add (having read ur recent convo with
another user) that i have checked out the help menu in flash and followed it
but to no joy !!
hi urami ...thanks very much with ur recent help mate on the sound issue ...i
took ur advice and got rid of the guitar riffs on the buttons !! sounds much
cleaner now and dont need to fade the music now as well !!!! got another teaser
for u tho .... bit of a basic one but very annoying all the same !! i haver
come to the end of a scene and just want the playhead to go back and play the
main menu again (in an earlier scene) when the goto menu scene button is
pressed .... i assumed this would be easy but ohhhh no !! can i get it to work
? not a chance !! once the button is pressed the play head goes to the next
scene as required ( where there is a little tween to bring the menu back up
again - but it is only a copy of the whole menu page without button instances
etc ) when it reaches the last frame of this i want to jump back to the menu
proper with the button instances etc ....so here i am using the goto and play
action to goto an earlier scene and frame .... this is the code

gotoAndPlay("2",191);
all this does is start the movie again from the very beginning tho !!! i have
tried this ...
{ gotoAndPlay("2",191);
}
just in case it needed the handlers but still no joy !!!!! oh master of all
flash where am i going wrong lol !!!!!
many thanks
bwclan

urami_
3/24/2004 7:17:27 AM

[quoted text, click to view]


This is common problem so don't be worry , we all came across that .
Something macromedia neglect to mention in manuals throughout many versions of flash.

I wrote about it many times but Jeckyl (forum regular participant) put it in way I would not
be able to explain better myself so I paste it for you :


SWF files that you publish have no scenes and no scene names. All your
scenes in Flash get concatenated into one long movie when published, with
each 'scene' playing in succession. The only special thing about a scene is
that on export, all objects you placed in the scene are removed at the end
of each scene (dynamically created movie clips don't get removed).

So, Flash Player cannot find a scene by name because there are no scenes and
no scenes names in the SWF file.

But .. how come you can use gotoAndPlay("scene 2",5) if there are no scenes
and Flash Player cannot find scenes by name? Well .. that's because it is
NOT the Flash Player that finds the frame when you use that syntax.
Instead, Flash itself finds the frame you specify and says to itself "aha ..
that is really the 35th frame of the movie" (if, say, scene 1 has 30 frames
in it) .. and so when it publishes the SWF file, it ACTUALLY generates code
that does a gotoAndPlay(35) instead. So the Flash Player is none the wise
and never knows the YOU specified it by scene name.

So .. how do you get around this. Very simple. Use frame labels instead
and do NOT use the scene name (eg. use gotoAndPlay(label); instead).

However, there is one further catch. Flash has a BUG in it, and if you
rearrange scenes it will get confused about where frame labels are and
generate incorrect code .. whether you specify the label directly or use a
variable. So .. now what do you do?

Well, you use _root.gotoAndPlay("label"); syntax instead. This does not suffer
from the Flash BUG, and so all should just work.

//

In addition , do not name things with numbers , labels, instance names etc... need to be starting
with characters . Flash will confuse it and might fail to works.
So , in your case :
gotoAndPlay("2",191);
place on frame 191 label name , call it frame191 than from button target it with

_root.gotoAndPlay("frame19");

It is good to develop a habit of empty layers.
Place empty layer on top of every other layer that stretch as long as the scene .
this allow you to place labels and action in one place w/o colliding with the existing content.
For instance in the middle of the tween you like ot have sound , in order to place it you need
a frame , which means you will need to tag it in the tween , putting on separate layer is always
good solution plus you can look for actions and labels in the same place throughout the whole movie
w/o scrolling up and down over the layers.






--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

urami_
3/24/2004 8:29:19 AM

[quoted text, click to view]

I would seriously consider .
I went few days back to MPH book store , they move location to bigger lot
in one of the largest shopping complex (newly build one) and they had stock clearance.
I was looking trough some server stuff and came across few flash books.
Just flip few pages . Man , some books are so ridicules that I wonder why would someone
ever bother . Like the Masters of flash , beside collaboration of few well known designers
there really isn't much content . The point of the book is to cumulate revenue on names of the authors
because that book sure is not to help you become one of them.
If you make study case and description for few complex projects , some components attached , sure
could be successful.


--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

Jeckyl
3/24/2004 10:44:49 AM
[quoted text, click to view]

I should write a book :):)

bwclan
3/24/2004 1:11:37 PM
thanks very much guys ........ i think a much deserved thankyou goes to all
like yourselves who give their time and expertise for free ..... i hope one day
to be able to do the same ......................
jolyon_russ
3/24/2004 2:18:26 PM
Urami,

Maybe you could ask Macromedia to fund a book with top tips from their forums.

Just a thought.


AddThis Social Bookmark Button