Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-29-2007, 12:16 AM   #1
Registered User
Join Date: Feb 2005
Posts: 74
Default use variable to declare instance name

Hi all,

I need some help, is late and am knackered...

I have a menu system which I am using across a HTML site. within the HTML pages I am going to set a variable according to the section you are in SEC1, SEC2...

This variable will be called into flash and used to define "menuSEL" in the code below... I then want to use this variable to determine a movie clips alpha level... How can I use the variable to declare the instance name? - the last line of code is wrong, but where is the mistake?

numButtonsSEL = 5;
for (i=1; i<numButtonsSEL+1; i++) {
this["SEC"+i]._alpha = 0;}

var menuSEL = "SEC1"
trace (menuSEL)
Thanks in advance

cubidimagery is offline   Reply With Quote
Old 07-29-2007, 12:20 AM   #2
Super Moderator
Cota's Avatar
Join Date: Jul 2001
Location: NYC
Posts: 10,175

ActionScript Code:
Color Wars™ | (kul′ər wôrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 07-29-2007, 12:39 AM   #3
Registered User
Join Date: Feb 2005
Posts: 74
Default thanks

Could have sworn I tried that!! Cheers, must be lack of sleep.
cubidimagery is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I declare a variable with another variable 2slow ActionScript 2.0 3 07-11-2007 08:31 PM
static class variable referencing class instance seppy ActionScript 2.0 3 03-07-2007 03:31 PM
Static Variable Vs. Instance Variable in Memory IceCo ActionScript 2.0 1 03-05-2005 09:02 PM
inheritance - Mortimer Jazz ActionScript 1.0 (and below) 10 07-24-2003 09:51 PM
Instance name within variable? jdriscol ActionScript 1.0 (and below) 1 11-05-2002 04:33 PM

All times are GMT. The time now is 11:19 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.