![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
Flash Actionscript - Why isnt my 'for' loop working?
onClipEvent (load) {
this._alpha = 0;
for (var a = 1; a<100; a++) {
this._alpha = a;
}
}spot any obvious errors? |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You can't begin a variable with an underscore in most languages. I don't know if AS is any different.
|
|
|
|
|
|
#3 |
|
Programmer
|
no, _alpha is a built-in property of a movie clip, actionscript/flash is different from any other language i can think of.
Im also working with the stage and the items on the stage, and where they go, and what to do, its confusing. If i wanted a certain movieclip to move to lets say 400x, 300y on the stage i would go into the actions for that object and put something like this. The _x and _y properties also begin with _, as well as _xscale, and _yscale, etc. onClipEvent(enterFrame){
this._x = 400;
this._y = 300;
} |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|