intelligent slide

  • plugin+
  • Newbie
  • Newbie
  • plugin+
  • Posts: 10

Post 3+ Months Ago

Hi people,

I am sure this is a simple query but I just can't get my head round working it out, I am pretty new to AS, maybe thats the problem:
I have four button links which trigger off a sliding panel (movie), how can I give Flash the intelligence to know which was the last button clicked so that it can send the previous panel back to its original state as well as slide the current one out? Hope this makes sense, here is an example:

Have they used an if / else chain to work out which one to slide back in (the links)

I have been trying to work this out for nearly 5 hours... AHHHGGG

  • joebert
  • Genius
  • Genius
  • User avatar
  • Posts: 13511
  • Loc: Florida

Post 3+ Months Ago

If all you looking to do is know what panel was the last to be opened create a variable named somthing like "lastOpened"and assign each button somthing like so,
Code: [ Select ]
buttonOne.onPress = function(){
   lastOpened = slideOne;
buttonTwo.onPress = function(){
   lastOpened = slideTwo;
  1. buttonOne.onPress = function(){
  2.    close(lastOpened);
  3.    open(slideOne);
  4.    lastOpened = slideOne;
  5. }
  6. buttonTwo.onPress = function(){
  7.    close(lastOpened);
  8.    open(slideTwo);
  9.    lastOpened = slideTwo;

The use of if chains for somthing like this is a size killer,
always telling the temp variable to close after assigning an object to that variable gives you one easy function instead of miltiple if, else if and so on :wink:

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 7 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-2017. Ozzu® is a registered trademark of Unmelted, LLC.