Hi;
I have loaded an external swf file by this code:
[AS]
createEmptyMovieClip(“movie”, 3);
loadMovie(“star.swf”, “movie”);
[/AS]
I want to know how to change some properties of this swf? For instance I want to change it’s _alpha from 100 to 0, or it’s scale.
Does the solution work for loaded images as well?
Any help on this, please?
mx-guest2004 ![:slight_smile: :slight_smile:](https://forum.kirupa.com/images/emoji/twitter/slight_smile.png?v=5)
createEmptyMovieClip("movie", 3);
loadMovie("star.swf", "movie");
you answered your own question. to refer to a movie clip, use the instance name. here, you specified it as “movie”. so, to change any of its characteristics after you have loaded it, just put its instance name and then the property. for your alpha question, it would be movie._alpha= 100 or 0 or whatever you want it to be. or, for its x coordinate: movie._x= 300. get the idea? if this isnt clear enough, let me know.
sam
Thanks sam,
I mean the changing of _alpha.
When loading I can give the “movie” an _alpha value, but how can I fade it in/out? Or change it’s scale over some frames for a kind of zooming effect?
mx-guest2004
You’ll have to wait till the movie is loaded…
scotty(-:
yea… once the movie is loaded, you have control of it. you can control every aspect of it with actionscript. or, you can simply change the actual movie’s timeline that you are loading. the movie you have loaded is the same as any other movie that exists on your timeline.
sam
Thanks guys. Here is a code made by a flash guru named divarch, and it’s works ![:slight_smile: :slight_smile:](https://forum.kirupa.com/images/emoji/twitter/slight_smile.png?v=5)
mx-guest2004
[AS]
function reScale(clip, targ, speed) {//re-usable,and extendable to all props
if (clip._xscale<targ) {
clip._xscale += speed;
clip._yscale += speed;//optional
} else {
clearInterval(reScaleInt);
trace(‘cleared’);//just to make sure
}
}
//continues from previous post
if(loaded==total){
reScaleInt = setInterval(reScale, 20, movie, 300, 10);
}
[/AS]
if(loaded==total){
reScaleInt = setInterval(reScale, 20, movie, 300, 10);
}
But like we’ve said, after loading;)
scotty(-:
That’s right. I meant AFTER loading. ![:slight_smile: :slight_smile:](https://forum.kirupa.com/images/emoji/twitter/slight_smile.png?v=5)
mx-guest2004