...

View Full Version : importing a swf in another swf



svibuk
05-28-2009, 12:25 PM
i have a fla with few buttons and images
few button are in the centre of the page which when clicked shld display another swf

but i am not getting it
i have the following code
on (release) {



createEmptyMovieClip("mc_clip", 15);


mc_clip._width=495.5;
mc_clip._height =318;
mc_clip._x = 500;
mc_clip._y = 300;
loadMovie("services.swf","mc_clip");
}

itsallkizza
05-29-2009, 06:22 PM
Though not ideal code for several reasons (e.g. you should be defining your onRelease handler outside the button, you should be explicitly placing your newly created empty movie clip by calling it from another movie clip, and it's best to pass the target as a reference rather than a string) but it does work.

If
a) you have "services.swf" in the same directory as your parent movie, and
b) you open up a blank fla, create a simple button, and place the following actionscript into it

on(release)
{
createEmptyMovieClip("mc_clip",15);
loadMovie("img.jpg","mc_clip");
}
then it will successfully insert your services.swf into your new fla at coordinates (0,0).

Your problem then lies in either your layering of movie clips, a conflict with an onRelease handler specified elsewhere, your coordinates are off, or your services.swf isn't acting as you expect it to.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum