Click to See Complete Forum and Search --> : action script not working
tmoore935
08-23-2003, 06:00 PM
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.
:confused: :confused:
FLASHPULSE
08-23-2003, 07:33 PM
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();
tmoore935
08-23-2003, 07:42 PM
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;
}
}
:D
Bob Hartzell
08-24-2003, 07:07 AM
Don't use add in line 4. Use +.
necromanthus
08-24-2003, 05:52 PM
Hello tim.
For future,try to use this syntax:
for(l=1;l<35;l++){
bar.duplicateMovieClip("bar"+l,l);
}
cheers
;)
tmoore935
08-24-2003, 07:54 PM
Originally posted by necromanthus
Hello tim.
For future,try to use this syntax:
for(l=1;l<35;l++){
bar.duplicateMovieClip("bar"+l,l);
}
cheers
;)
Thank you, this was the trick. I have been unable to do this for a couple of month's. I just do not get scripting. Mabey I could buy actioon script for dummies. (I did not have a problem with fortran or java or c++.)
The effect I wanted was here. (It is video card intensive)
http://www.diversioncentral.com/template/floaters.html
Thank you everyone:) :D
johnie
08-25-2003, 09:45 PM
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.
necromanthus
08-26-2003, 12:52 AM
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 !
:eek:
tmoore935
08-26-2003, 03:01 PM
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
johnie
08-26-2003, 06:34 PM
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 !
:eek:
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.
necromanthus
08-26-2003, 06:44 PM
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 (!?!).
:mrpimp:
roger_onslow
09-01-2003, 09:34 AM
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 :))
necromanthus
09-01-2003, 05:21 PM
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
:p
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.