-
switch/case code not working
I have a presentation in flash that consists of a main menu and 4 sections
it is all in one file. the main menu sits on frame 1 of the timeline, section1 sits on frame 2 etc.
from the main menu you can choose to go to each section directly or choose to play all.
this means that at the end of each section - depending on which option was chosen you either go to the next section, or back to the main menu.
i am trying to solve this currently with the following code.
code on the menu button......
on (release) {
_secton1.page = 1;
tellTarget ("_root") {
_root.gotoAndPlay(2);
}
}
what i was hoping is that this would take you to section one and would then be sent back to the menu when reaching this code that is placed near the end of section1....
switch (page) {
case 1 :
_root.gotoAndPlay(1);
}
the trouble is - its not working!!!! it just carries on past the frame where the code is, and so reaches the end of the section where I have the coding to take it on to the next section rather than back to the menu.
I thought an easy way to solve the problem would be to double up all the sections ( so i would actually have 8 sections) and then the coding is simple as you can have one set of section with one code, and another with the other.
....However the presentation is quite big as it is (it has full audio commentry) so doubling it in size is not an option as my computer runs out of memory during publishing.
Any idea's?
...Thanks in advance....
-
AKA [ Paul Bainbridge]
your checking for a number where this is possibaly a string
try this
code:
switch (page) {
case "1" :
_root.gotoAndPlay(1);
}
hope it helps
-
thanks for the suggestion, but its still not working.
has anyone got an alternative solution.....
cheers.
-
AKA [ Paul Bainbridge]
ah forgot about the break
code:
switch (page) {
case "1" :
_root.gotoAndPlay(1);
break;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|