i am new in flash and i would like to know how to resize an image if the image width exceed 400px.
here is part of my actionscript
function createContainer() {
_root.createEmptyMovieClip(“myContainer_mc”,_root.getDepth()-1);
//myContainer_mc.lineStyle(5,0x000000,100);
myContainer_mc.lineTo(_root.myWidth,5);
myContainer_mc.lineTo(_root.myWidth,_root.myHeight);
myContainer_mc.lineTo(0,_root.myHeight);
myContainer_mc.lineTo(0,5);
myContainer_mc._x = ((Stage.width-myContainer_mc._width)/2);
myContainer_mc._y = (Stage.height-myContainer_mc._height)/2;
}
function callImages() {
_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myMCL.addListener(_root.myPreloader);
_root.myClips_array = [];
_root.myPreloader.onLoadStart = function(target) {
_root.createTextField("filename_txt",_root.getNextHighestDepth(),0,0,100,20);
_root.filename_txt._x = 70;
_root.filename_txt._y = 305;
_root.filename_txt.autoSize = "left";
};
_root.myPreloader.onLoadProgress = function(target) {
_root.filename_txt.text = "Loading.. "+_root.myClips_array.length+"/"+_root.myImagesNo+" Completed";
};
_root.myPreloader.onLoadComplete = function(target) {
_root.myClips_array.push(target);
target._alpha = 0;
if (_root.myClips_array.length == _root.myImagesNo) {
moveSlide();
if (_root.myImagesNo>1) {
myShowInt = setInterval(moveSlide, (_root.mySpeed*1000)+1000);
}
}
};
for (i=0; i<_root.myImagesNo; i++) {
temp_url = _root.myImages*.attributes.file_preview;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());
}
function moveSlide() {
current_mc = _root.myClips_array[_root.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 300, 0, 1, true);
_root.target_mc++;
if (_root.target_mc>=_root.myImagesNo) {
_root.target_mc = 0;
}
_root.filename_txt.text = _root.myImages[target_mc].attributes.file_name;
next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}