LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-30-2004, 05:30 PM
slacker's Avatar
slacker slacker is offline
Artsy Moderator
 
Join Date: Apr 2001
Location: A Recliner in Philly
Posts: 804
Rep Power: 13
slacker is on a distinguished road
nested button scene change

Quote:
Originally posted by musky_mike 
This is a common problem that you should add (I still haven't figured it out).

Hey, allright! 2 birds and one stone.
You have a movie clip on the main stage. The movieclip contains a button. Now when you click this button you want Flash to gotoAndPlay Scene 2.

Someone told me it's immposible, but I doubt that.
I originally thought this would be plain and simple, but now i see why you were told it is impossible. However, as most things in flash, it is quite possible.
To get this to work, you need a function on the timeline that gives the button its code. Just make sure you have given your container movieclip, and the button instance names, and type them in. This code goes on the main timeline, and you're all set to go.
Actionscript:
containerMC.Scene_Change_BTN.onRelease = function (){
  gotoAndPlay("Scene 2", 1);
};


You can use these Assignment Functions (that is my made up name for these. I dont know their real name) to assign code to any object in your scene as long as it has an instance name. While I myself do not use this method often, some people use it exclusivly. It can be very helpful if you don't like hunting through several nested layers to change code, or if you have a bunch of similar buttons/movieclips that all require the same code (simply use a for loop)

doing this also lets you centralize your code, so you don't have to remember what code is on what button. it's all in the same place.
__________________
Play me in QUADRADIUS
It's like checkers with powerups, the perfect "bored at work" game.

Challenge Gusto
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
super simple question needs answer urgently! littlefoible Newbies 2 12-09-2008 03:02 PM
Simple Question - Primitive tools moriwenne Flash CS3 / Flash 9 2 11-29-2008 04:46 AM
simple as3 question. fhickler Newbies 2 02-25-2008 04:39 PM
Simple newbie display object hiarchy question cdb0324 Flash CS3 / Flash 9 2 09-28-2007 06:46 PM
Simple shape question Ash Newbies 4 03-18-2004 07:37 PM




All times are GMT. The time now is 09:11 AM.