To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Scripting & Backend

Reply
 
Thread Tools Search this Thread Display Modes
Old 05-23-2006, 12:04 PM   #1
cbcostanza
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
cbcostanza is offline   Reply With Quote
Old 05-23-2006, 12:38 PM   #2
MyFriendIsATaco
Bearded (M|G)od
 
MyFriendIsATaco's Avatar
 
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
MyFriendIsATaco is offline   Reply With Quote
Old 05-23-2006, 02:42 PM   #3
Chris_Seahorn
up to my .as in code
 
Chris_Seahorn's Avatar
 
Join Date: Dec 2004
Posts: 4,376
I do

Love the title of this post...had to mention it.
Chris_Seahorn is offline   Reply With Quote
Old 05-23-2006, 05:02 PM   #4
cbcostanza
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
cbcostanza is offline   Reply With Quote
Old 05-23-2006, 09:27 PM   #5
MyFriendIsATaco
Bearded (M|G)od
 
MyFriendIsATaco's Avatar
 
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;
}
that is the same as doing:
Code:
if(_root.goTo == 'news'){
     _root.newsfloat.play();
}else if (_root.goTo == 'page2'){
     _root.page2float.play();
}
MyFriendIsATaco is offline   Reply With Quote
Old 05-24-2006, 03:38 AM   #6
flash jordon
Member
 
Join Date: Apr 2005
Posts: 65
Quote:
Originally Posted by MyFriendIsATaco
switch is just a shorter version of if..elseif statements. for example:
Well, almost but there are some major difference. For instance:

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.

code:

for (i:Number = 0; i<40; i++) {
j = Math.floor(i/4);
switch(j) {
case 1:
case 3:
case 5:
X += 50;
break;
default:
X += 10;
}
}

Or something like that.

P.S. You guys need to get a new code parser
flash jordon is offline   Reply With Quote
Old 05-24-2006, 11:18 AM   #7
cbcostanza
Junior Member
 
Join Date: May 2006
Posts: 18
I still can't get this to work so if here is my file that I am working on could somebody please look at it and help me with the code. Thanks for your patience with this newbie.

Here is the file floats
cbcostanza is offline   Reply With Quote
Old 05-24-2006, 03:00 PM   #8
MyFriendIsATaco
Bearded (M|G)od
 
MyFriendIsATaco's Avatar
 
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.
MyFriendIsATaco is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > General Help > Scripting & Backend

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Forum Jump


All times are GMT -4. The time now is 05:05 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.