Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    importing a swf in another swf

    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");
    }

  • #2
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    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
    Code:
    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.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •