A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Inserting a SWF file

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    15

    Inserting a SWF file

    PLease can some one write me a script for inserting a SWF file into my animations..... ?? Add new element > Import a file it doesn't work os i need a script (to insert, place & give x,y coordinates & width & height too) sry for my bad english

  2. #2
    3DFA hobby scripter LewxX's Avatar
    Join Date
    Jul 2006
    Location
    Germany, Karlsruhe
    Posts
    198
    I have an swf compiler, which is able to extrakt every script/song/bitmap from every swf

    http://www.sot*hink.com/product/flashdecompiler/
    (remove *)

    PS:
    Quote Originally Posted by Ashantyk
    sry for my bad english
    do you speak german?
    Last edited by LewxX; 09-10-2007 at 01:36 PM.
    sorry for my bad school English
    btw. visit my Page: projects.lewxx.de
    or lewxx.de (<= German)

  3. #3
    Junior Member
    Join Date
    Sep 2007
    Posts
    15

    more choices

    i would like more choices/methods pls

    i would like a method like this:

    new_movie = this.createMovie ();
    new_movie.loadMovie ("url");

    but with complete code for positioning and setting height and width
    Last edited by Ashantyk; 09-11-2007 at 02:41 PM.

  4. #4
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681
    You are very close already ...

    new_movie = this.createMovie ();
    new_movie.loadMovie ("url");
    new_movie.x = x_position
    new_movie.y = y_position
    new_movie._lockroot = true; // this is always a good idea

    The new movie will have its own width and height which you can only change by changing the scale ...

    new_movie._xscale = x_scale_percent
    new_movie._yscale = y_scale_percent

    It is important to note that createMovie and loadMovie only work for exported Flash 8 movies. Flash 9 does not support this kind of movie loading, and 3DFA cannot load and play a compiled SWF file, so you should surround this code with an #if as2 directive ...

    #if as2

    new_movie = this.createMovie ();
    new_movie.loadMovie ("url");
    new_movie.x = x_position;
    new_movie.y = y_position;
    new_movie._lockroot = true; // this is always a good idea
    new_movie._xscale = x_scale_percent;
    new_movie._yscale = y_scale_percent;

    #endif

    _lockroot makes sure that the loaded swf uses its own root rather than having 'root' refer to the main movie root, which would break most loaded child movies.
    Cheers,
    kusco
    (3DFA Support Team)

  5. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    15
    Thx Kusco

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center