I know that a lot of my CS3 doesn't work in koolmoves unless the AS3 is modified. And I don't know AS3 well enough to always make it work. So this beta testing is actually good for me because it makes me pay attention.
Printable View
I know that a lot of my CS3 doesn't work in koolmoves unless the AS3 is modified. And I don't know AS3 well enough to always make it work. So this beta testing is actually good for me because it makes me pay attention.
What's important to keep in mind is that KM7 still will be KoolMoves and not a Flash CS3 clone. AS3 code that only uses classes from the flash.* packages should in most cases work with little or no adaptations. There are however still a few more complex things KM doesn't support yet. The fact that Remus already has some nice 3D code running in the current beta shows the next version of KM is capable of a lot but it is true some adaptations might be required for Flash CS3 code.
As for the components, they were never intended to be exactly compatible with the ones that come with Flash. One important reason is that Adobe has a lot of developers while the KM components were developed by one person. Another reason is that KM tries (as far as I know) to keep things simple. The Flash components have a lot of capabilities most KM users probably never would use. While the Flash components are vector based if I'm not mistaken, the KM components are bitmap based. This means any user with a bitmap drawing application, can create his own button skins and reuse those over and over.
Do you know how to use Math.random to change color.
I can use something like
symbol.alpha = (Math.random()*1) ;
to changethe alpha.
It would work with one which is AS3
http://www.diversioncentral.com/kool...domCircle.html
You mean like this ?Code:symbol.transform.colorTransform = new ColorTransform(0,0,0,1,Math.random()*256,Math.random()*256,Math.random()*256,0);
The Math.andom does't work in my app. I am posting it here because sometimes my script wants to repeat itself like it is running from frame to frame and then sometimes it works like it is suppose to which is display set of random circles and stop. I had this problem before but it disapeared and I assumed the beta was fixed. Of course I am running Vista so I don't know. In the end I want to create falling snowflakes.
function Main() {
for (var i:int = 0; i < 200; i++) {
var newCircle:BlueCircle = new BlueCircle();
var randomValue:Number = Math.random()*1;
newCircle.x = -100+Math.random()*500;
newCircle.y = -100+Math.random()*400;
newCircle.scaleX = newCircle.scaleY = randomValue;
newCircle.alpha = 1-randomValue;
newCircle.ColorTransform(0,0,0,1,Math.random()*256 ,Math.random()*256,Math.random()*256,0);
this.addChild(newCircle);
}
}
Main();
If you place the code in frame1, you don't need to embed it in a function. Just the code will do fine. This works fine for meIf it seems to repeat itself, that behaviour sometimes is caused by errors in the code. I suggest downloading the debug version of the standalone Flash Player 9 or 10 and previewing your movies using that. It will help you find errors in your code.Code:for (var i:int = 0; i < 200; i++) {
var newCircle:BlueCircle = new BlueCircle();
var randomValue:Number = Math.random()*1;
newCircle.x = -100+Math.random()*500;
newCircle.y = -100+Math.random()*400;
newCircle.scaleX = newCircle.scaleY = randomValue;
newCircle.alpha = 1 - randomValue;
newCircle.transform.colorTransform = new ColorTransform(0,0,0,1,Math.random()*256 ,Math.random()*256,Math.random()*256,0);
this.addChild(newCircle);
}
Flashplayer penetration for years has been helped by many an swf never even created with a Macromedia/Adobe flash authoring tool. Swish, Koolmoves, 3dFa and a slew of other swf authoring platforms sure didn't hurt their effort to get the penetration numbers where they are today. I know we tend to get humble if we compare this platform to Flash but let's be honest, it's rather amazing (at this cost) that it's even compared to it at all and not compared with the ton of cutesy swf tools out there instead.
I don't expect any of our components to be exact replicas of any of the adobe ones. I do expect ones that are similar to act similar (which they do and more) but in no way assume the API's will be completely cross compatible. Much like it was with us and AS1, it's pretty cool that MOST AS3 code users can find is adaptable to Koolmoves at all and shouldn't be downplayed.
That statement most likely doesn't mean much to most. To me it does because the last time I was able to drop a dateChooser component from a GUI onstage, it cost me 500 bucks for the software to do it and the exported swf was 300k larger!.
You guys go ahead and be humble all you want. I understand it's most likely politically correct. I don't feel the need nor do I see me downplaying just how powerful KM is for the money.
It's off the hook what you guys are doing. Absolutely amazing.
Thanks. I was trying something likeQuote:
Originally Posted by w.brants
var c:ColorTransform = new ColorTransform();
c.color = 0xFFFFFF;
newCircle.transform.colorTransform = c;
which works but I could not figure out how to get the random to work with this.
Just try to buy a skinable mediaplayer with close the the specs of the one included and you'll find you have to spend as much as Koolmoves cost itself..Quote:
Originally Posted by Chris_Seahorn
KM is CLEARLY the best bang for the buck, and with little to no serious shortcomings.
Chris, here's a small example of skinning a button using actionscript and an external skin image.
Place the script in frame 1 and the attached image in the same directory as the .fun file.Code:AssetManager.messenger.addEventListener('complete', main);
AssetManager.loadImages('rainbow_button.png');
function main(e:Event):void {
var b1:LabelButton = new LabelButton();
b1.setSkin('rainbow_button.png#4,4,14,14');
b1.setSize(90,24);
b1.move(20,20);
addChild(b1);
var b2:LabelButton = b1.clone();
b2.y = 50;
addChild(b2);
var b3:LabelButton = b1.clone();
b3.y = 80;
addChild(b3);
b1.label.text = 'Button 1';
b2.label.text = 'Button 2';
b3.label.text = 'Button 3';
}
Kewwwlll Move!
http://krazyaboutpizza.co.uk/Wilbert...omponents.html
Couldn't be easier. Very cool Wilbert!
on the fly skinning. users are really going to have a blast :)
http://krazyaboutpizza.co.uk/Wilbert...mponents2.html
There are several ways to add an action Phil.The code above still uses the external image attached to my previous example in this thread.Code:// We have to declare the objects on stage outside the main function.
// Variables declared within a function are local variables that can
// only be accessed by the function itself so that won't work.
var tf:TextField;
var b1:LabelButton, b2:LabelButton, b3:LabelButton;
var b4:LabelButton, b5:LabelButton;
// The AssetManager can handle sequential preloading of required
// assets to make sure they are available when they are needed.
// Another option is to embed the images inside the swf. In that
// case the following two lines aren't required and the code within
// the main function could be used directly without being placed
// inside this function.
AssetManager.messenger.addEventListener('complete', main);
AssetManager.loadImages('rainbow_button.png');
// The main function that is called when all external assets have
// been loaded.
function main(e:Event):void {
// Add a dynamic textfield.
tf = new TextField();
addChild(tf);
// Add a label button component and skin it.
// The four numbers after the # indicate the scaling grid.
// this affects what parts are stretched and what parts aren't
// so the button keeps looking fine when its size is changed.
b1 = new LabelButton();
b1.setSkin('rainbow_button.png#4,4,14,14');
b1.setSize(90,24);
b1.move(20,30);
addChild(b1);
// Clone the first button and add the clone.
// This way we don't have to skin all buttons separately.
b2 = b1.clone();
b2.y = 60;
addChild(b2);
// Do the same for button three, four and five.
b3 = b1.clone();
b3.y = 90;
addChild(b3);
b4 = b1.clone();
b4.x = 120;
addChild(b4);
b5 = b1.clone();
b5.move(120,60);
addChild(b5);
// Set the labels for the buttons
b1.label.text = 'Button 1';
b2.label.text = 'Button 2';
b3.label.text = 'Button 3';
b4.label.text = 'Button 4';
b5.label.text = 'Button 5';
// First way of setting an action.
// KM supports nesting of anonymous functions so we can
// assign an anonymous function directly.
b1.onClick = function(){
tf.text = 'Button 1 clicked';
}
// Second way of setting an action.
// We refer to a named function.
b2.onClick = b2Click;
// Third way of setting an action.
// We refer to a named function but do it this time by adding
// an event listener. The advantage is that multiple listeners
// can be added to one component.
b3.addEventListener('click', b3Click);
b4.addEventListener('click', b4and5Click);
b5.addEventListener('click', b4and5Click);
}
// Named function for button 2 click event.
// In case onClick is used, the Flash Player expects the function
// to have no parameters.
function b2Click():void {
tf.text = 'Button 2 clicked';
}
// Named function for button 3 click event.
// In case addEventListener is used, the Flash Player expects the
// function to have one parameter.
function b3Click(e:Event):void {
tf.text = 'Button 3 clicked';
}
// Named function for button 4 and 5 click event.
// The target property of the event this is passed to the function
// represents the button that broadcasted the event. We can use this
// to set one event function for multiple buttons.
function b4and5Click(e:Event):void {
tf.text = e.target.label.text;
tf.appendText(' clicked');
}
:yikes: http://www.akdemocrats.org/elton/Ski_Longjump.jpg
This is some kinda learning curve we are on!
skinable buttons... very cool.
From what i've used of KM 7, it's great. I haven't found any errors. Though i'm still working on figuring out AS3. The new components are fun to try and use.
And I would MUCH rather use KM than Flash. It's so much easier and can do everything i want it to. It's not just a text and image animator. Plus i get to save a few hundred dollars (if i was buying it new)
MultipleLabelScroll
http://krazyaboutpizza.co.uk/KM7_Lab..._Extended.html
http://www.diversioncentral.com/kool...domCircle.html
Chris said it was to quiet so here is something that I did.
Sweet!
:thumbsup: :thumbsup: :thumbsup: