Help with advanced Flash buttons!

Started by BaconXBits, April 4, 2009 02:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BaconXBits

#20
Quote from: ThorIt shouldn't be hard at all.

button.onRelease = function()
{
nextScene();
}

and the command for the other one should be prevScene();

again, give the buttons the proper instance names and paths and it should work perfectly

[edit] also I only have flash 8 so  I  can't open any of the other .flas in here (i.e. I can't see what code you're using)[/edit]



I'll try out your suggestion sometime in the near future.

Below is a Flash 8 .fla of my buttons.

f0d

#21
look bacon bits you can nip this problem in the bud. you need to keep in mind this post:
Quote from: Joelasticotthis causes scene actions not to work because using _root. makes flash treat the timeline as a movie clip, and movie clips don't have scenes. I've created a simple function that will do the scene control in your movie, so here's the fla. All the code is explained. I haven't tested it much though, so if you encounter any problems, let me know

so whats happening is joelasticots code on the main timeline isn't working, and you need another way to remedy the problem. im no AS genius but after looking at it, i think this could mean you have to do one of two things.

the first option is it might be a simple error in the code, and you could look through it to make sure the instance names of your symbols correspond with his AS. but thats hard to figure out if joelasticot himself doesnt take a look at it. from the looks of it, he might have even made it AS3 by accident. he did say he hadnt tested it much.

the other option is to ditch scenes altogether and make every scene play out sequentially on the main timeline, each in their own graphic symbols (that way pause and play will still work). then use .root gotoAndPlay commands for the scene to scene controls. if your computer is fast enough to handle this i think you should do it because its the absolute simplest solution to everything.




edit: ok i just used the controls in an actual movie. the scene to scene control which is giving you trouble work fine for me, and i think i know why

make sure you put this code in not just the first frame of your movie, but the first frame of every scene


function sceneControl(control:String):Void
{
   // "switch" checks the value of control, which is the
   // parameter we've sent, then it does the appropriate action
   switch(control)
   {
      case "next" :
      nextScene();
      break;
      
      case "prev" :
      prevScene();
      break;
      
      case "menu" :
      gotoAndPlay("Menu", 1);
      break;
      
      default :
      break;
   }
}
I have more of a life writing this review at 1145 pm than you guys do making these movies. . .

BaconXBits

#22
Quote from: f0dmake sure you put this code in not just the first frame of your movie, but the first frame of every scene
AHA!  Problem solved!  I ran into an issue with the flash stopping upon hitting the buttons after taking your advice, but I applied my newly-acquired AS mastery and added a "play();", and now everything's working perfectly.

Thanks to everyone who helped me out, I'll be sure to do a special thanks section for all you cool dudes (not that it means much but hey I'm grateful)

Edit: Is there by any chance a way to keep subtitles off throughout the following scenes if they've been toggled off?  They reset back to "on" upon arriving at the next scene.