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.
|
|
|
|
|
![]() |
||
help needed for flash variables
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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????? |
|
|
|
|||
|
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... |
|
|||
|
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. |
|
|||
|
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
|
![]() |
| Tags |
| help, needed, flash, variables |
| Thread Tools | |
|
|
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 |