Back button

  • mtolgao
  • Newbie
  • Newbie
  • mtolgao
  • Posts: 7

Post 3+ Months Ago

Hello,

In a post (flash-forum/back-button-previous-frame-t30698.html), I have read digitalMedia's solution, and I would like to ask something. How is it possible to combine gotoAndStop(backFrame); and _root.page = backFrame; _root.play(); ? Because I would like to do something like this with contact form. http://tolga.ozses.net/yeniProje.swf. I don't want to go back only, I want to do this smoothly (i.e. when I click the Back button (Geri button in the iletisim part), the contact form should move to the right and the previous frame should move from the button). This is what happens in the other buttons at the moment. I hope I made myself clear.

Best regards,
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

Code: [ Select ]
 
var goBack = false;
onEnterFrame = function()
{
   if (goBack)
   {
      backFrame--; gotoAndStop(backFrame);
      if (stopCondition)
         goBack = false;
   }
}
 
myButton.onRelease = function () { goBack = true; }
 
  1.  
  2. var goBack = false;
  3. onEnterFrame = function()
  4. {
  5.    if (goBack)
  6.    {
  7.       backFrame--; gotoAndStop(backFrame);
  8.       if (stopCondition)
  9.          goBack = false;
  10.    }
  11. }
  12.  
  13. myButton.onRelease = function () { goBack = true; }
  14.  

stopCondition is whatever condition you want the back animation to stop. For example, a frame: if (_root.currentframe == frameX)
  • mtolgao
  • Newbie
  • Newbie
  • mtolgao
  • Posts: 7

Post 3+ Months Ago

Excuse me, but I am a novice at flash. Can you tell me where to enter the code? The back button, or a frame? Also, is this AS2 or AS3? Probably I should have mentioned that the code was supposed to be AS2.

Best regards,
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

this is AS2, and you need to place the code on a keyframe (just make sure that your button appears on the timeline when you are on that keyframe).
Also make sure you enter the instance name for your button (either name the instance myButton, or name it as you want, but then change myButton in the provided code with the name that you entered). Ah, and one slight mistake i seen, i corrected it now, it was
if (stopCondition) backFrame = false; -> should be goBack = false;

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 8 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
 
cron
 

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