|
-
Relaxing
 Originally Posted by Chris_Seahorn
I'm looking at one run as I type built with a custom class so trust me, KM7 will certainly allow you to create something like (or better than even) the example you posted 
I know wilberts will be better. I just wanted to show a differnt AC3 direction. And my example is like 10 lines of code. As for real coding, As I pound thru with Brute force, I am learning AS3. I have not seen it discused here but I had to relearn using all code from the frame and packages and not to do any noodle coding.
Any programming language is at its best before it is implemented and used.
-
KoolMoves Moderator
I hear ya Tmoore, it has taken me a little time to get started. But once I dug in and tried creating my one componet (very simple one) and now I've been able to bring that component into KM7 and it works It's kinda exciting.
In case anyone is interested here is the code for the dice component I showed
PHP Code:
/**
* @author Bret Lanius
* @version 0.1
* Intended class for use with Koolmoves 7
*/
package com.bretlanius.game {
import flash.display.*;
import flash.geom.*;
public class Dice extends Sprite{
private var _number:int;
public var _bg:int;
public var canvas:Sprite = new Sprite;
public function Dice():void {//set defaults
_number = 6;
_bg= 0xf5f5f5;
}
public function getNumber():int {
//retrieve value
return _number;
}
public function setBg(c:int):void {
_bg = c;
}
public function draw():void {
//Clear it first before redrawing
canvas.graphics.clear();
var y1:int = 18;
var y2:int = 50;
var y3:int = 80;
//redraw visual representation of die
//draw box
canvas.graphics.beginFill(_bg, 1);
canvas.graphics.lineStyle(1, 0, 1, false, "normal", null, "round");
canvas.graphics.drawRoundRect(0, 0, 100, 100, 9);
var y:int = 5;
//draw dots
var fillType:String = GradientType.LINEAR;
var colors:Array = [0xc8c8c8, 0x000000];
var alphas:Array = [1, 1];
var ratios:Array = [0, 255];
canvas.graphics.lineStyle(.4, 0xffffff, 1);
canvas.graphics.beginGradientFill(fillType, colors, alphas, ratios);
if (_number == 1) {
canvas.graphics.drawCircle(y2,y2, 10);
}
if (_number == 2) {
canvas.graphics.drawCircle(y1, y1, 10);
canvas.graphics.drawCircle(y3, y3, 10);
}
if (_number == 3) {
canvas.graphics.drawCircle(y1, y1, 10);
canvas.graphics.drawCircle(y2, y2, 10);
canvas.graphics.drawCircle(y3, y3, 10);
}
if (_number == 4) {
canvas.graphics.drawCircle(y1, y1, 10);
canvas.graphics.drawCircle(y1, y3, 10);
canvas.graphics.drawCircle(y3, y1, 10);
canvas.graphics.drawCircle(y3, y3, 10);
}
if (_number == 5) {
canvas.graphics.drawCircle(y1, y1, 10);
canvas.graphics.drawCircle(y1, y3, 10);
canvas.graphics.drawCircle(y2, y2, 10);
canvas.graphics.drawCircle(y3, y1, 10);
canvas.graphics.drawCircle(y3, y3, 10);
}
if (_number == 6) {
canvas.graphics.drawCircle(y1, y1, 10);
canvas.graphics.drawCircle(y1, y2, 10);
canvas.graphics.drawCircle(y1, y3, 10);
canvas.graphics.drawCircle(y3, y1, 10);
canvas.graphics.drawCircle(y3, y2, 10);
canvas.graphics.drawCircle(y3, y3, 10);
}
addChild(canvas);
}
public function roll():void {
//generate new number
_number = (6 * Math.random())+1;
}
}
}
Just getting this working was a real learning experience for me. And this is the kind of thing I would recommend to anyone wanting to learn. I did this in Flashdevelop using the FLEX api before KM7 beta was ready then only had a minor error when I used it in KM but Wilbert helped me sort it out.
-
Chris is right TMoore, it won't be a problem to create something like that.
KoolMoves itself comes with a simple spectrum analyzer that is also used by the media player component.
Event handling and using the display list might take a little time to get used to.
Maybe this page from the Adobe livedocs explains a bit about the display list
http://livedocs.adobe.com/flash/9.0/main/00000142.html
-
That web bloke
I feel like the kid with his nose pressed against the sweet shop window, and the chosen few are pushing it, haven't felt like this since v6 was launched. Earlier you mentioned that those beta testing were conversant with as3, but from this thread that is clearly not the case. I think I speak for a few in here that stand on the outside again. Particularly as some of them have consciencously contributed help and koolexchange examples for existing versions.
-
Only about 3 people are playing with the beta which at this point is not fully functioning.
-
Senior Member
I have not recieved a beta in some time but that could be for a few reasons. But I can tell you guys have been working hard with AS3 and KM7 looks to be interesting. Nice work guys!
-
Relaxing
 Originally Posted by FLASHPULSE
I have not recieved a beta in some time but that could be for a few reasons. But I can tell you guys have been working hard with AS3 and KM7 looks to be interesting. Nice work guys! 
I have not either but I am not the best tester. I looked today at your website flashpulse. I guess you are really into the minimalist look.
Any programming language is at its best before it is implemented and used.
-
up to my .as in code
-
Great work Chris !
It looks professional. I'm glad you like the new things and am looking forward to your contributions once KM7 goes final
-
up to my .as in code
Check your inbox
-
Senior Member
-
-
up to my .as in code
It's I who thank you. Thanks you for all your hard work Bob. I know this version upgrade is unlike any other before it as far as work involved for you and all I can say is Lucky Monkey is very lucky indeed to have you. We are too
-
so i've been following this forum since I'm looking forward to KM 7. But just to clarify (since i don't know). With AS 3 being supported does that mean AS 1 won't be? I know that they're different (and AS 3 is supposed to be better) but Koolmoves is only a hobby for me and not something i do full time. I don't want to relearn all the codes i know at once. And does it mean older files with AS 1 won't run properly? Call me stupid, but i think it's a good question for the people who don't know as much.
we keep making fool proof systems, but the world keeps making better fools. 
-
This is a very good question. Export at Flash 8 or below will only accept AS1. Export at Flash 9 is tricky. Flash 9 export will only accept AS3 (in KoolMoves). If there is existing AS1 code or motion scripts or components, there is complication and how that will be handled is still not fully determined. AS1 cannot be mixed with AS3 in the same movie but swfs containing AS1 can be loaded into movies with AS3. There will be an opportunity to convert AS1-based components into newer AS3 components that have greater flexibility and are skinned. There will also be AS3 equivalents to some of the motion scripts which will provide much better CPU utilization. For remaining AS1 objects, they will probably be encapsulated into AS1 movies and under-the-covers loaded into the AS3 movie. There will be 100% compatibility if the export remains below Flash 9. At Flash 9 export, scripting at the frame or button level added by the user will have to be converted to AS3. I hope I have answered your question. I think you can appreciate that there is considerable technical challenge in achieving a Flash 9 export using prior projects.
-
KoolMoves Moderator
using a custom class from internet
Here's an example of using a refelection component that I found online.
fairly easy to get working in KM7 once Wilbert helped me load an image in.
At this point everything has to be coded, the AS3 components are not working in the GUI yet.
Cool thing is that because of the display hierarchy the reflection is a child of the image so it will move with it and hide the image the reflection hides and so on, you don't have to deal with it once created. This would have been hard to do in AS1
-
That web bloke
-
KoolMoves Moderator
 Originally Posted by Stoke Laurie
^ No link Bret?
DOH!!!!!
Sorry
http://bretlanius.com/flash/km7stuff...ctiontest.html
-
That web bloke
-
it's great feature, is this reflection can be applied in to text as well?
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
|