
Welcome Guest
|
|
|
#1
|
||||
|
||||
|
Consolidation of ActionScript [F8]&[F9]
have been running into the same problem multiple times and I know there is an easier way to do this.. any ideas out there?
here would be an example of some code: PHP Code:
|
|
#2
|
||||
|
||||
Code:
btn1.onPress = function(){
doStuff(_name)
}
btn2.onPress = function(){
doStuff(_name)
}
btn3.onPress = function(){
doStuff(_name)
}
btn4.onPress = function(){
doStuff(_name)
}
function doStuff(butName){
//Take the first 3 characters away from the name and leave the number.
var id = butName.slice(3)
//Do stuff to/with the number here
}
__________________
.:To me AS is like LEGO, Only for the big Kids :. - Site - Blog - Glasgow Flasher - Activeden - bringmadeleinehome.com |
|
#3
|
||||
|
||||
|
I was thinking of maybe a loop...
and I know this won't work... PHP Code:
also, keep in mind that I know this doesn't work PHP Code:
|
|
#4
|
||||
|
||||
|
Why wont this work?
Actionscript:
for (i=0; i<5; i++) {
var mc : MovieClip = "btn"+i;
mc.onPress.function=(){
doStuff(_name)
}
}
function doStuff(butName){
//Take the first 3 characters away from the name and leave the number.
var id = butName.slice(3)
//Do stuff to/with the number here
}
__________________
.:To me AS is like LEGO, Only for the big Kids :. - Site - Blog - Glasgow Flasher - Activeden - bringmadeleinehome.com |
|
#5
|
||||
|
||||
|
I don't know too much about the slice stuff that you have here but if the...
PHP Code:
|
|
#6
|
||||
|
||||
|
sorry....
meant to have... PHP Code:
|
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flash ActionScript 2.0 Learning Guide | chetan1 | Flash 8 |
0 | 05-12-2008 06:14 AM |
| ACtionscript 2.0 vs. 1.0 Issue | funk45 | Actionscript 2.0 Components |
1 | 11-07-2005 05:58 AM |
| When I "convert to symbol" my Actionscript gets buried! | sunstorm | Flash 5 and below | 2 | 12-04-2004 11:05 PM |
| Can ActionScript check windows registry / txt. file? | janice_2k | Flash MX ActionScript |
0 | 06-04-2004 10:27 AM |
| JOB OPENING: Flash ActionScript Programmer | barn | Work/Job Opportunities | 0 | 09-10-2001 11:41 PM |



