|
|
|
#1 |
|
Junior Member
Join Date: May 2006
Posts: 18
|
scripting cramp!
Hi! I'm kind of a newbie and I am doing a website for a custom parade float company. So in my site when a user clicks on the initial "start parade" button it brings a parade float across the screen and it stops in the middle where I will load a movie of the home information. This will happen for every navigation button that the user clicks on(a different float for every button). I am wanting to do some code so that when I click on another navigation button the current float on the screen will pull away and the proper float will come in behind it like a parade. I am having trouble figuring out code on how to do this. If anyone could help I would be so appreciative!
chris |
|
|
|
|
|
#2 |
|
Bearded (M|G)od
Join Date: Dec 2002
Location: Awesomeville.
Posts: 3,045
|
you need to set up a _root.goTo variable. when the navigation button is clicked, the animation for the float going away is played and _root.goTo is set to whatever the next page is, ie: _root.goTo = 'page2'; , after if it is done, there is a switch statement for the different pages/floats and it calls the corresponding page. i hope you understand what im talking about
__________________
[YDEK:] YDEK Productions | Flickr | Twitter | Facebook [Me:] MyFriendIsATaco.com | MattRobenolt.com | 528Hazelwood.com | I can take pictures, too! |
|
|
|
|
|
#3 |
|
up to my .as in code
Join Date: Dec 2004
Posts: 4,376
|
I do
Love the title of this post...had to mention it.
__________________
YaYa - Yet Another YouTube App at Adobe Showcase KM-CODEX Desktop - "Power Windows" and "Color My World" at Adobe Showcase KM-CODEX - Resources for Koolmoves, Flex, Adobe AIR & SWF Studio Users ABCms Post Authoring - Adobe AIR Marketplace in-R-tube (Search/View/Download YouTube) - Download this inside KM-CODEX Desktop! |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2006
Posts: 18
|
Thanks for the feedback. I think I follow you with the goto stuff, but I am a little confused on the switch statement. Could you please expound on that. Thanks
|
|
|
|
|
|
#5 |
|
Bearded (M|G)od
Join Date: Dec 2002
Location: Awesomeville.
Posts: 3,045
|
switch is just a shorter version of if..elseif statements. for example:
Code:
switch(_root.goTo){
case 'news':
_root.newsfloat.play();
break;
case 'page2':
_root.page2float.play();
break;
}
Code:
if(_root.goTo == 'news'){
_root.newsfloat.play();
}else if (_root.goTo == 'page2'){
_root.page2float.play();
}
__________________
[YDEK:] YDEK Productions | Flickr | Twitter | Facebook [Me:] MyFriendIsATaco.com | MattRobenolt.com | 528Hazelwood.com | I can take pictures, too! |
|
|
|
|
|
#6 | |
|
Member
Join Date: Apr 2005
Posts: 65
|
Quote:
1) switch() can only check equality. It can NOT check > or < . 2) You can check mulitple cases at a time by not including a break imediately after the case. eg.
P.S. You guys need to get a new code parser
|
|
|
|
|
|
|
#8 |
|
Bearded (M|G)od
Join Date: Dec 2002
Location: Awesomeville.
Posts: 3,045
|
yeah, i didnt really wan to get into depth with switch(), i just showed him enough for his situation, i like to let people learn something on their own.
__________________
[YDEK:] YDEK Productions | Flickr | Twitter | Facebook [Me:] MyFriendIsATaco.com | MattRobenolt.com | 528Hazelwood.com | I can take pictures, too! |
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|