TriStateTuners.com :: Home of Tristate Auto Enthusiast  

Go Back TriStateTuners.com :: Home of Tristate Auto Enthusiast > Community > Off-Topic
Register Rules & Info

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-20-2008, 12:25 PM   #1
Erik
Tri-State Post Whore
 
Erik's Avatar
 
Join Date: May 2006
Location: Glenside, PA
Member #1962

My Ride:
2001 Audi A6 2.7 Twin Turbo

iTrader: (4)
Flash programs?

hey guys. In college, im taking multimedia and one of the classes im taking called multimedia concepts. Its actually Adobe Flash programming. If you are relatively familiar with the newest form of Flash code, actionscript 3.0, pleaseeee help me out. This isnt to cheat in anyway, the teacher just says it is a little too advanced for me, although after taking VB, C++, HTML&XHTML, code does not worry me.

gotoAndPlay(239);
function randNum (min:Number, max:Number ):Number
{
min = 1;
max = 6;
var randNumber:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randNumber;
}
var n:int;
n = randNum(1, 6);
trace(n);
if (n == 1)
{
gotoAndPlay(1);
}

else if (n == 2)
{
gotoAndPlay(40);
}

else if (n == 3)
{
gotoAndPlay(80);
}

else if (n == 4)
{
gotoAndPlay(120);
}

else if (n == 5)
{
gotoAndPlay(160);
}

else if (n == 6)
{
gotoAndPlay(200);
}


What im having trouble with is the if-else-if statements. I declare variable n to the random number generator(randNum), then set its value equal to another value in order for the "movie" to start at a certain point on the timeline. The biggest issue im encountering is that the only "if" statement that works is the first! I dont see why non of the other ones are declaring when a random number aside from 1 is calculated.

any help would be MUCHHHH appreciated.
thanks.
__________________
--Eric

'96 Mazda Miata | FM V-Maxx Coilovers | Jackson Racing Exhaust/Intake GONE
To view links or images in signatures your post count must be 10 or greater. You currently have 0 signatures.

01' Audi A6 2.7 Twin Turbo | Daily | NoMods
Erik is offline   Reply With Quote
 

Bookmarks


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Who programs? CS3, Flash, etc help needed please Jjaeger240 Off-Topic 2 04-12-2009 12:08 AM
X-mas Eve Volunteer Programs... ITSTOCK Off-Topic 6 12-05-2008 01:39 PM
Computer Programs Eclipse GSX 61 Off-Topic 8 12-03-2008 08:17 PM
instant messenger programs jdm free Off-Topic 21 04-07-2008 09:45 PM
DVD making programs. Spocknasty Off-Topic 6 11-21-2007 12:06 PM


All times are GMT -4. The time now is 09:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.