passing variables need help

  • Matrix8369
  • Born
  • Born
  • Matrix8369
  • Posts: 2

Post 3+ Months Ago

Hello every one I have been looking for 2 days on how to do this and cant find a thing to help. these are my layers

actions layer
button 1
button2
button 3
button4
animationclosing
animation 1
animation 2
animation 3
animation 4


ok basicaly i want to user to click on the button and on click i want to time line to finish playing the animationclosing then depending on the button the user click the time line should jump to were the animation 1-4 starts. here is the code i am try to get to work

The code I have on my four buttons are
Button 1

on (release) {
var i=1;
this.parent.gotoAndPlay(27);
}

Button 1

on (release) {
var i=2;
this.parent.gotoAndPlay(27);
}

Button 1

on (release) {
var i=3;
this.parent.gotoAndPlay(27);
}

Button 1

on (release) {
var i=4;
this.parent.gotoAndPlay(27);
}

then when the button is clicked it will play untill the time line gets to frame 45 and on frame 45 in the actions layer i have some code that goes as follows

if (i == 1){
gotoAndPlay(46);
}else if (i == 2){
gotoAndPlay(87);
}else if (i == 3){
gotoAndPlay(126);
}else if (i == 4){
gotoAndPlay(166);
}

how do I pass the variable i so that this if else works because no matter what, it takes the user to and plays frame 46 (animation 1)
  • Matrix8369
  • Born
  • Born
  • Matrix8369
  • Posts: 2

Post 3+ Months Ago

I am willing to use difrent cod eif I have to just make it work
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

i think its better to declare your variable at the root timeLine ...

then
Code: [ Select ]
on (release) {

_root.i=1;

this.parent.gotoAndPlay(27);

}
  1. on (release) {
  2. _root.i=1;
  3. this.parent.gotoAndPlay(27);
  4. }


and so on ....

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 3 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.