help needed for flash variables

This is a discussion on "help needed for flash variables" within the Flash & Multimedia Forum section. This forum, and the thread "help needed for flash variables are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 1st, 2003, 05:10
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
help needed for flash variables

Can anyone tell me if this is the correct way to declare a variable? --> SceneSelected = "purpose";
// note : SceneSelected is the variable and purpose is the string value...

.... the big story is that

1. i've got a movie and has 2buttons

2. In the scenario the user has clicked the 'purpose' button, flash would set a variable, SceneSelected, and set its value (string) to 'purpose'. after which, the user is redirected to frame 90

In the scenario that he, however, clicks the 'sixmessages'button... flash would set a variable, SceneSelected ( the same as above ) but value is set to 'sixmessages'instead... the user is also redirected to frame 90

3. When frame 90 is played, it ends at frame 110.

4. At frame 110, i want to verify if the user has clicked on which button ( sixmessages or purpose )

Therefore, i use the following code :-


if (SceneSelected="purpose") { //if sceneselected is purpose
gotoAndPlay("purpose", 1); // go to the purpose scene,playframe 1
}


if (SceneSelected="sixmessages") { // if sceneslected is sixmessages
gotoAndPlay("sixmessages", 1); // then go to six messages n play
}

stop(); //stops at this frame


all this code doesn't work. any suggestions?????

  #2 (permalink)  
Old Sep 1st, 2003, 05:14
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
hold on; has to add something...

the big idea is that i want flash to redirect the user to the 'purpose'scene if he had clicked on purpose earlier on

and
to redirect the user to the 'sixmessages' scene if he had clicked on the six messages button earlier on...
  #3 (permalink)  
Old Sep 1st, 2003, 05:48
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok,

SceneSelected = "purpose";

is the correct way to declare a variable, however it isn't the correct way to check if a variable is equal to a value.
For that you would use:

SceneSelected == "purpose";

You must ensure that the variable is being declared properly and checked properly. If you are using a string variable and plan to use string methods with it, then you must also ensure you have declared it as a string appropriately - Flash actionscript help provides more information on that topic or you can ask here.
  #4 (permalink)  
Old Sep 1st, 2003, 10:59
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
I realised after browsing through an actionscript reference book that == should be used instead of =...( as what sirkent said in the above post )........ Thanks for your quick reply anyway
Closed Thread

Tags
help, needed, flash, variables

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variables from PHP to Flash tox0tes Flash & Multimedia Forum 4 Dec 29th, 2007 06:46
Trying to pass JSP variables into input:select attributes. Help badly needed danwms Other Programming Languages 2 Apr 19th, 2007 09:44
Flash and PHP Session Variables saxy46 Flash & Multimedia Forum 0 Jan 27th, 2007 18:21
Passing Flash variables between frames lostnights Flash & Multimedia Forum 0 Jan 22nd, 2007 17:09
Passing variables from Flash to PHP LostProphet Flash & Multimedia Forum 6 Aug 31st, 2006 14:05


All times are GMT. The time now is 16:52.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43