|
-
Relaxing
action script not working
This script I cannot make work in the actions and sounds overview.
objects = 35;
loop = 1;
while(loop <= objects){
duplicateMovieClip("bar","bar"add loop,loop);
loop = loop + 1;
}
duplicateMovieClip("txt","txt1000",1000000);
stop();
the error is:
line 4 expecting a , or a )
The clip works but will not replicate itself.
Any programming language is at its best before it is implemented and used.
-
Senior Member
I'm not good at action script but I didn't get any errors with this change. NOT TESTED
objects = 35;
loop = 1;
while(loop <= objects){
duplicateMovieClip("bar","bar"+ loop,loop);
loop = loop + 1;
}
duplicateMovieClip("txt","txt1000",1000000);
stop();
-
Relaxing
I am using version koolmoves 4.0 so that may be the difference. I originaly used the code for flask mx and was trying to get it to work in koolmoves. Thank you
the original code was in the time line and the following was in a mc. The idea is that a clip could be randomized 35 times to give a background effect. Each clip would have a different size. I got the code from www.kirupa.com's site. I did figure another way around.
(I should have given this in the beginning)
the code that was in the movie clip was
onClipEvent(load){
_x = Math.random()*800;
speed = Math.random()*5 + 1;
_y = Math.random()*600 - (_height/2);
_xscale = Math.random()*400;
_yscale = Math.random()*400;
_alpha = Math.random()*30+10;
}
onClipEvent(enterFrame){
_x += speed;
if(_x >= 800){
_xscale = Math.random()*150;
_yscale = Math.random()*150;
speed = Math.random()*5 + 1;
_y = Math.random()*600 - (_height/2);
_x = _width*-1;
_alpha = Math.random()*30+10;
}
}
Any programming language is at its best before it is implemented and used.
-
Don't use add in line 4. Use +.
-
undead creature
Hello tim.
For future,try to use this syntax:
for(l=1;l<35;l++){
bar.duplicateMovieClip("bar"+l,l);
}
cheers
-
Relaxing
Any programming language is at its best before it is implemented and used.
-
Honestly you should start off with Javascrot for dummies and then move onto the book "Actionscript the definitive guide".
Flash 5+ actionscript model is based on Ecma 262 (JavaScript), however the Flash 4 scripting language resembles Agol (Pascal, Oberion, ect) family languages. What most AS books do not tell you is that in Flash 5 and higher both syntax models are allowed in Flash(At the same time no less). Most third party tools that allow scripting, like KoolMoves /LM2 /3DFA / Nione Imperator (I have not seen SWiSH Max so can't comment on that one), only implement the Flash 5+ model though. KoolMoves specifically will reject the Flash 4 syntax. Becuase both syntax models can be used interchangably in Flash's Actionscript it causes great confusion among would be developers especially if they are are sane and have prior expierince with progaming.
If you learn ECMA 262 first then you won't be tempted to use the naughty depreciated FLash 4 Syntax and likewise will be able to spot it.
-
undead creature
Originally posted by johnie
...(I have not seen SWiSH Max so can't comment on that one)...
Someone told me that SwishMax use a "pseudo" v6 ActionScript.
Few examples: onEnterFrame() , onLoad() , etc
A possible (future) competition between KoolMoves and SwishMax ?
Probably ...
But imagine KoolMoves v5.0 with a symbol-library capability !
-
Relaxing
Originally posted by johnie
Honestly you should start off with Javascrot for dummies and then move onto the book "Actionscript the definitive guide".
Actually on Sunday i ordered "flash mx for dummies" from amazon.com
I do have the definitive guide but I did not stick to it.
I also remember you suggesting this some time ago. Thanks
Any programming language is at its best before it is implemented and used.
-
Originally posted by necromanthus
Someone told me that SwishMax use a "pseudo" v6 ActionScript.
Few examples: onEnterFrame() , onLoad() , etc
A possible (future) competition between KoolMoves and SwishMax ?
Probably ...
But imagine KoolMoves v5.0 with a symbol-library capability !
So they copied the LM2 model. Adobe took the 5/6 AS model and further standardized it on ECMA (262) by doing the same thing. They have onmouseover(), onload(), ect.
-
undead creature
Originally posted by johnie
So they copied the LM2 model. Adobe took the 5/6 AS model and further standardized it on ECMA (262) by doing the same thing. They have onmouseover(), onload(), ect.
That's right.
Also,another intresting part is that all V6 commands are available (if my "source" is the right one),but the internal player is Flash V5 (!?!).
-
FYI: just to clear up a little:
SWiSHmax scripting is not a copy of either LiveMotion or Flash directly.
It has on(press,release) {..} etc like Flash
It has onEnterFrame() {...} like LM
If has some of its own things onFrame(..) {..}, onSelfEvent(press) etc
The internal player is mostly Flash 4 (with some support for things like Key, Date, Array etc) and with emulation of math functions etc when exporting to Flash 4. But if you export to Flash 5/6 and play in Flash Player 5/6/7, then you can get at the methods available with that player (eg you can do code that wors with XML, say).
(hope you don't mind me posting here )
Last edited by roger_onslow; 09-01-2003 at 08:46 AM.
Roger Onslow - SWiSHmax: its here!
-
undead creature
Originally posted by roger_onslow
hope you don't mind me posting here
Not at all.
roger,send my best wishes to David M and Hugh B.
You all are invited to become KoolMoves fans.
cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|