;

PDA

Click to See Complete Forum and Search --> : v7-AS3 Help me!How 2 use Knob in KM ,thanks


songxp03
04-15-2009, 11:54 AM
Open KM and paste code as below,Iwant to use Knob,but seeing nothing ,why?

import km.components.knob;

import flash.display.Sprite

import km.skins.*;



var b:Knob = new Knob();

ScriptedSkin.applyTo(b);

b.move(50,50);

b.onChange = updateShape;

b.SetRotationRange(300);

b.Setscale(0.5);

b.setstopColor(200);

b.setstops(4);

b.setvalue(1);

addChild(b);



var s:Shape = new Shape();

s.x = 80;

s.y = 80;

addChild(s);



function updateShape():void {

s.graphics.clear();

s.graphics.beginFill(ns.value << 16);

s.graphics.drawRect(80, 80, 90, 90);

s.graphics.endFill();

}

w.brants
04-15-2009, 01:33 PM
Currently the ScriptedSkin class doesn't support the Knob component. You have to assign an image manually. Also a lot of your code consists of non existing commands. I suggest you study the KM 7.0.4 .fun file I attached to this reply.

songxp03
04-15-2009, 08:22 PM
Thanks you very much.