I need to load images within my Flash project
I don’t want to use the Loader class cause the images are from a different domain.
I load images with a TextField
Here is my code:
var ti:TextField = new TextField();
ti.border=1
ti.htmlText += " <img id='movieInTxt' align='center' src='"+pic+"' />";
allMC[counter].img.addChild(ti);
I am loading the images to movieClip in a shape of a box.
I want to position the image in the center.
How can I make it ?
I tried ti.autoSize = TextFieldAutoSize.CENTER but it doesn’t work…
Any suggestions how to load an image and position it in the center ?
You can use
<p align='center'><img /></p>I guess.You can totally use a Loader on domain you don’t own since you don’t access any advanced properties on the image (like pixel-level manipulations). You can then access the size of the image, and center it in your container.
AS3 doc says :
You can force flashplayer to not check
crossdomain.xmlfile by passingfalsein theLoaderContextconstructor :