Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Arrays in Flash

Original Message
Name: Deimos
Date: September 5, 2007 at 14:37:09 Pacific
Subject: Arrays in Flash
OS: Windows Xp home edition S
CPU/Ram: CPU:1.99Ghz Ram:1024mbs
Model/Manufacturer: Hp pavilion dv5000
Comment:
hello everyone!

I am trying to learn actionScript and I have a question about arrays;
I want to create an array with different strings and then, when the user preses the mouse button i want a text box(named fruity) to show one of the strings of my array randomly.
Here is my AS:
fruit = new Array()
fruit.push("bannana");
fruit.push("peach");
fruit.push("orange");
fruit.push("apple");
fruit.push("watermelon")
function onMouseDown(){
_root.fruity.text=fruit[Math.random()*5]
}

but when I press the Mouse button it appears "undifined"...why does this happen and how can I solve this problem?

Best Regards

[D]ei[M]o[S]


Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: September 5, 2007 at 18:25:55 Pacific
Subject: Arrays in Flash
Reply: (edit)
fruit[parseInt(Math.random()*5)]

Report Offensive Follow Up For Removal

Response Number 2
Name: Deimos
Date: September 7, 2007 at 07:28:32 Pacific
Subject: Arrays in Flash
Reply: (edit)
it sais "Type mismatch"...

[D]ei[M]o[S]


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Arrays in Flash

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




CPU and Graphics Upgrade Questions

VIRUS ALERT in Taskbar, HELP!

DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC