Be a Supporter!

Heirarchies and if statements. AS2

  • 296 Views
  • 6 Replies
New Topic Respond to this Topic
d8b
d8b
  • Member since: Nov. 2, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Heirarchies and if statements. AS2 2009-03-18 09:28:35 Reply

I have 2 questions about actionscript.

Question Number 1:
Okay umm so I have a menu, and there's a two movieclips.
On the first movieclip(Labeled "INST_BUTTON"), its a transition for a button to appear. The last frame it stops and a button is formed.
On the second movieclip, it is labeled "INST". It shows a Images appearing. The first frame is blank and has a "stop();" script. From the second frame to the sixteenth frame, it shows the button appearing. From the seventeenth frame to the thirty-second frame, it shows a animation loop, on the last frame of the loop it goes back to the seventeenth frame so it loops again and again. And from thirty-third frame to the forty-eighth frame, it shows the image fading out.

What I want to do is, from the first movieclip's button, hmm I'll just put this in pseudo code.

on(rollOver){
     _("INST").gotoAndPlay(2);
             if(rollOut at Frame 17){
                      gotoAndPlay(33);
             }else if(rollOut at Frame 18){
                      gotoAndPlay(34);
             }else if(rollOut at Frame 19){
                      gotoAndPlay(35);
             }else if(rollOut at Frame 20){
                      gotoAndPlay(36);
             }else if(rollOut at Frame 21){
                      gotoAndPlay(37);
                           etc~~
              }else if(rollOut at Frame 32){
                      gotoAndPlay(48);
}
}

If you don't understand, just ask.


Date-B.

BBS Signature
d8b
d8b
  • Member since: Nov. 2, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Heirarchies and if statements. AS2 2009-03-18 09:30:13 Reply

Actually, I asked both questions in that thingy.

Just fix the code, and tell me what parts I was wrong at.


Date-B.

BBS Signature
d8b
d8b
  • Member since: Nov. 2, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Heirarchies and if statements. AS2 2009-03-18 10:17:37 Reply

Bump


Date-B.

BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Heirarchies and if statements. AS2 2009-03-18 11:15:20 Reply

Not sure exactly what you're asking, but try this

on(rollOver){
     INST.gotoAndPlay(2);
}

on(rollOut){
	if(_currentframe==17){
		gotoAndPlay(33);
	}else if(_currentframe==18){
		gotoAndPlay(34);
	}else if(_currentframe==19){
		gotoAndPlay(35);
	}else if(_currentframe==20){
		gotoAndPlay(36);
	}else if(_currentframe==21){
		gotoAndPlay(37);
  	}else if(_currentframe==32){
		gotoAndPlay(48);
	}	
}

- - Flash - Music - Images - -

BBS Signature
d8b
d8b
  • Member since: Nov. 2, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Heirarchies and if statements. AS2 2009-03-18 11:34:53 Reply

It doesn't work.
Heirarchies are difficult. :/
I need to get both scripts to refer to the 'INST' movieclip.
And INST.//actions
Doesn't work.


Date-B.

BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Heirarchies and if statements. AS2 2009-03-18 15:40:10 Reply

At 3/18/09 11:34 AM, d8b wrote: It doesn't work.
Heirarchies are difficult. :/
I need to get both scripts to refer to the 'INST' movieclip.
And INST.//actions
Doesn't work.
on(rollOver){
     _root.INST.gotoAndPlay(2);
}

on(rollOut){
	if(_currentframe==17){
		 _root.INST.gotoAndPlay(33);
	}else if(_currentframe==18){
		 _root.INST.gotoAndPlay(34);
	}
      //etc etc
}

- - Flash - Music - Images - -

BBS Signature
d8b
d8b
  • Member since: Nov. 2, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Heirarchies and if statements. AS2 2009-03-19 00:10:25 Reply

Awesome! It works!


Date-B.

BBS Signature