hello
how can i auto fit external image into circle
https://e.top4top.net/p_7998xa0z1.jpg
Printable View
hello
how can i auto fit external image into circle
https://e.top4top.net/p_7998xa0z1.jpg
any help ,
please
You probably want to create a mask inside the circle movie clip and load the image into a layer below that. You canmess with the scale of the image once you know how big it is (after it has been loaded).
i will try and i will tell you if ok or not
thanks
i used the mask but the image not auto fit inside the circle
That was part 2 of my answer... You have to load the image to find out how big it is, then you can compare it to the size of your target movie clip and change the scale of the loaded image to fit/fill the target.
You can find an explanation and example here: https://stackoverflow.com/questions/...into-flash-as3
The relevant AS3 code (this one fits the image to the stage):
PHP Code:
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.Event;
var myLoader:Loader = new Loader();
var image:Bitmap;
var url :URLRequest = new URLRequest("im1.jpg");
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
myLoader.load(url);
function onImageLoaded(e:Event):void {
image = new Bitmap(e.target.content.bitmapData);
var mw:Number = stage.stageWidth;
var mh:Number = stage.stageHeight;
/* if you set width and height image same with the stage use this */
image.width = mw;
image.height = mh;
mc.addChild(image);
}
hi Northcode
i copy and past your code but there are codes not action in swish script
http://c.up-00.com/2018/03/1521642588791.jpg
thanks Northcode and i hope edit my file
I'm not sure if Swish supports AS3, but you should be able to find an AS2 version of this code (or convert this code) without much trouble.
The basic structure you need is:
PHP Code:
var mcl:MovieClipLoader = new MovieClipLoader();
var obj:Object = new Object();
obj.onLoadInit = function(mc) {
// todo: resize mc to fit target_mc here
};
obj.onLoadError = function(mc, message) {
// todo; handle errors here
};
mcl.addListener(obj);
mcl.loadClip(image_url, target_mc);
sure Swish supports AS3