Basic Initialisation through actionscript

33 views
Skip to first unread message

Anthony Vanden Bossche

unread,
Feb 8, 2012, 12:07:04 PM2/8/12
to Flex ObjectHandles
Hello,

I found your flex component and would very much like to use it in my
project. However I don't even get a simple image to work with it
through actionscript. My code gives the error "Implicit coercion of a
value of type com.roguedevelopment.objecthandles:ObjectHandles to an
unrelated type flash.display:DisplayObject." on canvas.addChild(oh).

Am I doing something obvious wrong here?


//testing objecthandles component
var canvas:Canvas = new Canvas();
canvas.width = 400;
canvas.height = 400;
var img:Image = new Image();
img.source = 'assets/handenwassen.jpg';
img.x = 100;
img.y = 200;
var pages:Array = myBook.getChildren();
//var oh:ObjectHandles = new ObjectHandles();
//oh.addChild(img);
var oh:ObjectHandles = new ObjectHandles(img);
canvas.addChild(oh);
pages[0].addChild(canvas);

Craig McLeod

unread,
Mar 22, 2012, 5:34:57 AM3/22/12
to Flex ObjectHandles
Hi,

If its flex 4, try addElement ;)

On Feb 8, 7:07 pm, Anthony Vanden Bossche
Reply all
Reply to author
Forward
0 new messages