typically I have been doing stuff like this
to display mcs on events//This adds a custom cursor quick and dirty
circle_mc.addEventListener(MouseEvent.CLICK,showThis);
function showThis(evt:MouseEvent):void
{
var circ:MovieClip = new Circ ();
addChild (circ);
Mouse.hide();
circ.x=mouseX
circ.y=mouseY
circ.startDrag(true);
}
}
now I really want to make the jump to arrays big time.
This code is a trainwreck but I hope I can demostrate what I'm trying to do in AS 3
What I really want to learn how to do is call items either from the library,var cursorSwap:String = new String();
var i:Number;
var cursorArray:Array = new Array(
[my_mc.circle, "circle"],
[my_mc.circle, "square"],
[my_mc.circle, "diamond"])
circle_mc.addEventListener(MouseEvent.CLICK,circleSwap);
square_mc.addEventListener(MouseEvent.CLICK,squareSwap);
diamond_mc.addEventListener(MouseEvent.CLICK,diamondSwap);
function circleSwap(evt:MouseEvent):void
{Mouse.hide();
//cursors.circle.startDrag();
for(i=0; i<cursorArray.length; i++);
cursorSwap = cursorArray[this.id][1];
circle.x =mouseX;
circle.y =mouseY;
}
a frame in a movieclip and either just diplay them or drag them around as with a cursor.
Most demos I see handle DATA, or just return a string using "trace" I get that but I wish I could see stuf that is more visual.





Bookmarks