Adobe Dreamweaver Forums



Last 10 THreads :         Narrowed down Flex Builder 3 question (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          Unable to load resource module ... at MethodInfo-635() (Last Post : MotionMaker - Replies : 2 - Views : 5 )           »          Fill graphics (Last Post : SiHoop - Replies : 0 - Views : 1 )           »          motion blur filter (Last Post : ssailer - Replies : 3 - Views : 4 )           »          files are one level too deep (Last Post : ricksepulveda - Replies : 4 - Views : 5 )           »          Drag Drop dont work (Last Post : prophotoguy - Replies : 0 - Views : 1 )           »          Need assistance converting some AS2 code to AS3 (Last Post : DPSwebmaster - Replies : 0 - Views : 1 )           »          HELP! (Last Post : SpAM_CAN - Replies : 2 - Views : 3 )           »          template base pages: relative paths don't update (Last Post : Marney - Replies : 2 - Views : 3 )           »          CS4 trials expired too early (Last Post : John Waller - Replies : 4 - Views : 5 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: , ,



Reply
  #1 (permalink)  
Old 07-09-2008, 02:33 PM
doug777
 
Posts: n/a
Diggs:
Default Add bitmap to container

I've got a bitmap and I want to add it to a VBox.

How do I convert the bitmap to a display object that implements the IUIComponent interface?

Doug


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-09-2008, 02:33 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Add bitmap to container

var uic:UIComponent = new UIComponent();
uic.addChild(myBitmap);
addChild(uic);
Reply With Quote
  #3 (permalink)  
Old 07-09-2008, 02:33 PM
doug777
 
Posts: n/a
Diggs:
Default Re: Add bitmap to container

Yes all the explanations in the docs are like this, but this assumes that I am
writing this in a class that extends the Sprite class, which I am not and then
what exactly do you add to the VBox? Because you can't add the Sprite that then
exists.

I have found that this works directly however:

var content:Image = new Image();
content.addChild(myBitmap);
content.height = myBitmap.height;
content.width = myBitmap.width;
myVBox.addChild(content);

Is there some reason why this incredibly simple way of doing this is not
documented somewhere?

Doug

Reply With Quote


  #4 (permalink)  
Old 07-09-2008, 04:24 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Add bitmap to container

You can do this in the <script> tag of an mxml document.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 07:45 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk