Groups | Blog | Home
all groups > flash actionscript > june 2005 >

flash actionscript : help writing if statements



missus_ebb
6/4/2005 6:52:39 PM
Hi,

I'm looking for some scripting help. I've got a main movie (main_movie.swf)
and a second movie (content2.swf) which I will be loading into main movie at
level0. after a button is pressed. However, before loading it in, there is an
exit animation or a transitional wipe, if you will. I'm using actionscript so I
can implement other actions/changes more easily. The transition is basically a
white square that moves over the content until its obscured - its an mc that
uses on ClipEvent (enterframe) to move it to a new postion. You can see the
code/how far I've got with the mock flas here
http://eatest.mysite.wanadoo-members.co.uk

I'm assuming I need to use "if statements" to check whether the wipe has
reached its destination (its final _x position) and if it has then it can be
instructed to load content2.swf. I?m not entirely sure. However, I don't know
how to write the if statements and where they should be placed. For example, a
controller mc with the if statements its frames? Any better suggestions
appreciated too, I'd be so grateful for any help.

Ps. I'm using Flash 5.

Cheers

missus_ebb

the fleece
6/4/2005 7:16:44 PM
first of all, look in the action script referance dictionary (in the help) under 'if'.

the syntax is this:
if(statement){
missus_ebb
6/4/2005 11:14:12 PM
Hi,
Thanks for the info I'll have a go at writing this and see how it goes...
but first can you clarify where to place the if statements - I don't get the
part about deleting itself. you see, I have the code to move the mc in
onClipEvent (enterFrame) then when it has reached its final position (it will
be off stage) I will load in a new swf. are you saying I need to write the code
into the onClipEvent handler?

my code right now is:
onClipEvent (load) {
//starting position
_x=750
wipex=750
}
onClipEvent (enterFrame) {
//movement
_x+=(wipex-_x)/5
//end postion
wipex=-500

Thanks again for your time.
AddThis Social Bookmark Button