Load as2 inside as3

hi,
I came a cross a strange problem while trying to load (using Loader Class) an as2 swf inside an as3 swf.
I'm not sure that it matters but the as2 size is bigger.
when i load the as2 file (even without addChild ) the overall swf that I run suddenly becomes larger and i guess getting the size of the as2 so it will fit.
I want the parent as3 swf to keep its same size(scale).
does anyone know how to fix this problem?
*When i loaded an as3 instead of an as2, it worked like it should. That's why I know the as2 is the source of the problem.
Thank you

scale your loader so it fits the way you want.  ie, if your loaded swf is 800x600 (with nothing on the back-stage) and you're loading into a 350x375 swf, after loading is complete, use:
loader.width *= 350/800;
loader.height *= 375/600;

Similar Messages

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • Load as2 swf in as3 swf

    Hi All,
    I am new to this forum.
    Can anyone tell me how to load as2 swf in as3?
    If this is possible,can anyone give me some sample example?
    Thanks
    Harshal

    You can talk to loaded AVM1 (AS1/2) SWF using LocalConnection. I used Grant Skinner's SWFBridge class in the past and worked very well:
    http://gskinner.com/blog/archives/2007/07/swfbridge_easie.html
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • Load AS2 swf into AS3 swf

    here is the code i'm using:
    var url:String = "avm1.swf";
    var urlrequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loaderListener(loader.contentLoaderInfo);
    loader.load(urlrequest);
    function loaderListener(dispatched:IEventDispatcher){
    dispatched.addEventListener(Event.COMPLETE, assignSWF);
    function assignSWF(event:Event){
    addChild(loader.content);
    here is the error i get:
    It is illegal to move AVM1 content (AS1 or AS2) to a
    different part of the displayList when it has been loaded into AVM2
    (AS3) content.
    Is there a different way to do this?

    addChild(loader)

  • Problems with loading AS2 assets into AS3 container

    Hello,
    in a Project I use the AS3 Loader Class to load
    AS2-swf-files. The swf-files are placed into different subfolders,
    since they're using the same filenames and subfoldernames for
    config-files etc.
    The Problem is: Whatever swf-file I load first, it is
    working, but every swf-file after that fails. It seems to be
    loaded, but it's not working correctly.
    I'm using the attached code (easy as it seems) to unload the
    present content and then loading the new one. But also using a
    separated second loader to load the second file is not working.
    I made some kind of testcase (a loader with 2 content
    swf-files) for you, so you can understand what I'm talking about.
    Here you can download the
    testcase (28
    MB).
    It seems like there is a bug in the flash player 9 that
    prevents the AS2-content from being unloaded correctly from an AS3
    file. Can you confirm that there is such a bug? Or do you have an
    explanation for this behavior? Or even better: a solution or
    workaround?
    Thanks a lot!

    Thanks for your help, but as said ("But also using a
    separated second loader to load the second file is not working.")
    even when using a second loader (with a different name) the second
    file loaded will not work.
    I'm removing any EventListener from the first loader,
    unloading and then nulling it.
    But to me it seems, that the first content is not garbage
    collected and because of that, even when loaded with an other
    loader the first loaded swf-file interferes with the second.
    I came to this conclusion, because the first loaded swf-file
    is still working after trying to load the second file. And just
    more weird: the first loaded file is in the same state and also
    after closing the Flash-Player.
    You can see it for yourself: download the testcase. Start the
    testcase.swf. Load a contentfile. Skip a few pages. Quit the Flash
    Player. Start the testcase.swf again and load the same contentfile.
    You will see it's at the same position like before quiting the
    Player.
    And I can't help, but that seems like a bug to me...

  • Loading AS2 swf in AS3 fails - sort of

    I have an AS 3.0 file that loads a 2.0 swf. That 2.0 swf
    loads other 2.0 swf.
    When running in the AS 3.0 shell, the file is loaded, but the
    onLoadComplete() function is not called. The clip is loading, but
    no mclListener events are raised. (ie: mclListener.onLoadError ,
    mclListener.onLoadProgress, etc.) If I load the same chain with an
    AS 2.0 parent, the events are raised.
    Any ideas why, or what to do about it???
    Thanks -
    This is the AS 3.0 code:
    //Load the editor.
    var loader:Loader = new Loader();
    var request:URLRequest = new URLRequest("BDAS_Editor.swf");
    loader.load(request);
    addChild(loader);
    This is the AS 2.0 code in the BDAS_Editor.swf:
    var my_mcl:MovieClipLoader = new MovieClipLoader();
    var mclListener:Object = new Object();
    my_mcl.addListener(mclListener);
    my_mcl.loadClip(myPath,Template_mc);
    mclListener.onLoadComplete = function(target_mc:MovieClip,
    status:Number):Void {
    trace("onLoadComplete " + target_mc);

    Ok I found it out (somewhere else).
    The reason was, that you can't use levels when you load content in AS3.
    That Version works:
    var my_mcl:MovieClipLoader = new MovieClipLoader();
    var mc:MovieClip;
    var myListener:Object = {
        onLoadInit: function(target_mc:MovieClip) {
           trace("*********First my_mcl instance*********");
           trace("Movie clip = "+target_mc+" is now initialized");
           target_mc.play();
           fertig();
        onLoadError: function(target_mc:MovieClip, errorCode:String) {
           trace("ERROR CODE = "+errorCode);
           trace("Your load failed on movie clip = "+target_mc+"\n");
    my_mcl.addListener(myListener);
    function load_swf(url:String) {
        mc.removeMovieClip();
        mc = createEmptyMovieClip("mc", getNextHighestDepth());
        my_mcl.loadClip(url, mc);
    var testurl:String = "any_swf_in_as2.swf";
    load_swf(testurl);

  • Use this As2 in As3

    Hello,
    i have this code
    var url = _level0.video;
    player.contentPath = url;
    this catch a url and load on flash player.
    this works fine in As2, but in As3 dont work.
    i use a converter As2 to As3 but the result is it:
    package  {
        var url = _level0.video;
        player.contentPath = url;
    i not a As programmer i only use video function on flash,
    my question is, how to use my code on ActionScript 3 ??
    Thank you !!

    Thanks for reply,
    the variable video i get from html and php.
    example:
    player.swf?video=<?php echo $_GET["video"]; ?>
    and the variable video i get from html
    <a href="index.php?video=video.flv"></a>
    ok, i discard a converter !!
    to use a contentPatch source of flash ?
    but i can load a external videos ??
    without ActionScript ?
    Thank you !

  • HTML Link -AS2 fine, AS3 weird behaviour

    Hi Guys, I'm working on a project at the moment, and am
    seeing weird behaviour with the way my swf handles html links
    inside dynamic textboxes. When rendered as a AS2 file, the link
    works on a release as expected. When its inside a AS3 file the link
    will only work if the user right click and chooses 'open in new
    window' was there a change in behaviour how AS3 handles these
    links, or is there now an declaration needed to be made to allow
    these link to have the old behaviour?
    The project calls for xml data and embedded in that is a html
    link. Originally I thought it might have been the way I'd formed
    the xml so I tried with a hardcoded version instead (dynamic
    textbox, add text -> highlight -> add link through properties
    tab). But I still see the same behaviour between the as2 and as3
    versions.
    Any help would be greatly appreciated.
    Cheers.

    Actually, the ''href'' attribute is supposed to direct the browser to a new URL, etc., not run a script. Instead, use the ''onclick'' event attribute:
    ''<a onclick = “$('.div-feedback').fadeIn();”></a>''.
    Happy coding!

  • Loading XML in AS3

    OK, so I think I have the basics of loading XML in AS3. But I
    can't seem to access the info once it is loaded. I'm using the to
    load the .xml file:
    var myXML:XML = new XML();
    var XML_URL:String = "music.xml";
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    var myLoader:URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener("complete", xmlLoaded);
    function xmlLoaded(event:Event):void
    myXML = XML(myLoader.data);
    trace("Data loaded.");
    But when I go to trace the .xml file with this:
    trace(myXML.toXMLString());
    I get nothing. However, if I place this trace inside the
    xmlLoaded function it traces it out. My problem is I want access to
    the info outside of that function. What am I doing wrong? Any
    advice or help would be greatly appreciated. Thanks.

    backpages,
    > But when I go to trace the .xml file with this:
    >
    > trace(myXML.toXMLString());
    >
    > I get nothing.
    This looks like a matter of timing. Your first five lines
    are
    encountered one after the other, starting with var myXML
    through
    myLoader.addEventListener(), which calls a function defined
    immediately
    below that. The function is called when the "complete" event
    is dispatched,
    which may take longer or shorter depending on the size of the
    XML document
    and network traffic. If you put a trace() statement
    immediately below that,
    Flash will execute that too -- and at the moment it does,
    your XML document
    hasn't loaded yet.
    > However, if I place this trace inside the xmlLoaded
    function it
    > traces it out. My problem is I want access to the info
    outside
    > of that function. What am I doing wrong?
    I copy/pasted your code exactly, then followed it with this:
    var t:Timer = new Timer(5000);
    t.addEventListener(
    TimerEvent.TIMER,
    function():void {
    trace(myXML);
    t.start();
    ... which waits five seconds, then runs that trace(). Sure
    enough, it
    outputs the XML contents.
    If you want to use the myXML variable elsewhere in your
    movie, you just
    have to make sure those other locations don't reference the
    variable until
    it has a value (or account for a lack of value in the logic
    they use). You
    might, for example, put a stop() action in frame one, along
    with the
    existing code (and instead of my timer), then have the
    "complete" event
    handler issue a play() action. In later frames, the myXML
    variable would
    have the data you need, because the playhead won't advance
    until the data
    have been loaded.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Major gaming system Migration from AS2 to AS3

    I have a major project entirely in AS2. It is made of a
    Multimedia Application, which provides access to functions needed
    to load games, save information, insert *.jpg files... The 50+
    games each have their own graphic.swf and engine.swf, where the
    graphics deal with gameplay and the engine communicates with the
    Multimedia Application.
    If the Multimedia Application is migrated to AS3 but the game
    swf files remain the same, will the functions still be able to
    communicate (call functions and send references to objects)?

    No, AS2 and AS3 are absolutely different animals. There are
    some techniques (search for as2 as3 bridge in the net) that create
    a bridge which are cumbersome in my view.

  • Still having issues loading AS2 movies

    I'm loading AS2 movies in a AS3 environment. The AS2 movies
    use Tweener (any other tweening engine gives the same results btw).
    If I load a AS2 movie the first time, a tween that uses a time and
    easing property runs fine. When I load the AS2 movie the second
    time... no go (the AS2 movie is removed... loader.unload, and the
    loader is nullified, no listeners...). If I remove the time and
    easing property on the tween, the 'tween' (it's now simply a new
    value for x or y...) runs fine every time.
    Is this some sort of cache issue? Broken GC kglad? Anyone
    experienced this too or does anyone can shed some light on this?
    Ideas maybe what I can try to solve this?

    Have you removed the page as i get redirected to http://steamcurriculum.blogspot.in/p/home.html/whatsmissing/index.html
    I do not see any edge realted content even in the source of this page

  • Problem loading AS2 movies

    I'm loading AS2 movies in a AS3 environment, using a Loader.
    Movies load, but they loose some onRelease handlers. This behaviour
    is consistent. Some onRelease handlers in the AS2 work (all the
    time), some not. Anyone have the same experience or is there a
    solution?

    just ran across this note from the docs:
    "If the loaded content is an AVM1 SWF file (written using
    ActionScript 1.0 or 2.0), it cannot be cross-scripted by an AVM2
    SWF file (written using ActionScript 3.0). However, you can
    communicate between the two SWF files by using the LocalConnection
    class."
    might want to check into the LocalConnection class. you may
    be able to construct some methods to pass values, but you still
    will not be to 'script' from one version to another - however if
    you're clever with you method construction you may be able to
    utilize data gathered within the AVM1 by a AS2 script and pass it
    for use in the AVM2 script.

  • As2 and As3 on same Flash Player

    If i set AS2 codes to play in Flash Player 9, is it possible
    that this swf can load an As3 swf at the same Flash Player using
    As2 codes???
    These swfs both play in same virtual machine which is player
    version 9 but the other is coded with As2 and the other is coded
    with As3. How can an AS2 load a swf coded in AS3 on same Flash
    player?
    Is this possible?
    If yes, how? if no, why not?

    AS2 and AS3 swfs cannot exist in the same Flash Player
    virtual machine - each Flash Player instance (version 9 and
    greater) create different address spaces/virtual machines because
    the requirements of AS3 and AS2 are so different.

  • AS2 with AS3 integration

    Hi.
    I have loads of games in AS2 but a freelancer is developping games in AS3. Can I use a container movie in AS3 and load both AS2 and AS3 games in. Otherwise I would have to update all games into AS3. Would all games have to be published to the same flashplayer? ie: FS7 etc...

    you can use an as3 swf to load as2 swfs.  if you need to communicate between the two swfs, use the localconnection class.

  • AS2 or AS3

    Hello, i'm somewhat decent in flash. I know AS2, i started
    learning AS3 today and find it to be more complicated and has so
    many extra steps in coding. Number one thing i hate is having to do
    all the code on the timeline, it will get so full of code if i have
    several buttons/movieclips that need code, no way to do code when
    you click on the button/movieclip in AS3 unlike 2.
    Would it be dumb for me to continue to use AS2 and learn more
    of it, or should i keep trying to learn AS3..... I don't do super
    complex stuff, mostly timeline navigation and animations.
    I also feel like there is way more room to make errors in 3
    because you have to type everything unlike AS2 where i was able to
    use the actions frame (use that plus tool that had the drop down
    menu).

    I'm in the same position, just starting to move from
    intermediate comfort with AS2 to a fresh beginning with AS3...not
    so easy for a guy who has so little logical thinking that I failed
    algebra in high school! I too am a bit annoyed by all the extra
    steps involved, such as having to add EventListeners for mouse
    events, when these really ought to be simplified and there by
    default, like in AS2. For example, why can't onMouseDown remain as
    a built-in behavior rather than having to take up 2 lines of code
    to insert it each and every time now?
    On the other hand, I am delighted at the way a lot of the
    inconsistencies in AS2 have been gotten rid of. No more having to
    remember when to put .x and when ._x, and so on. And now that I'm
    finally starting to learn how to use external classes, I see the
    beauty in it, and AS3 is custom-made for this. It seems that if you
    ever want to really advance in ActionScript programming, you need
    to start working with creating your own classes, and as long as
    you're going to learn those from scratch, may as well learn it in
    AS3.
    Putting AS on buttons was outdated practice years ago. It
    makes much greater sense to place all script on the timeline, with
    comments to separate it. Try programming the simplest game where
    objects are moving around and colliding, all controlled by script,
    and then a couple coded buttons control them. Bugs are inevitable,
    and debugging script when it's partly on the timeline, some is
    attached to main movie buttons, and some attached to movie clips
    inside movie clips, is a nightmare. Once you do scripting on the
    timeline, you'll never want to go back to the crude practice of
    attaching script to objects.
    Overall, it's a steeper climb than I'd have liked, to upgrade
    my knowledge from AS2 to AS3. But ultimately I think it's the best
    idea.

Maybe you are looking for

  • Printing from my MacBook Pro on my Windows 7 printer.

    Until 2 weeks ago I had no issues. I had a Windows XP box with a local Epson printer. From my MacBookPro, I was able to print wirelessly to that printer directly. All I did was select it from my list of printers and off I went. My XP box died. I repl

  • Pages 5.1 is unable to save a new file

    If I start a new Pages (5.1) document, I cannot save it.  Also, if I duplicate a Pages document that I can open and continue to work on, I cannot save this duplicate document either.  It does not matter what folder I select, new or existing.  I get t

  • Function Module creation in 4.6C

    Hi techies, I am not an ABAPer, but just copying Function Module code from 3.1 R/3 to 4.6C R/3. In 3.1, for the Table Parameter "E_DATA", there are two columns 'Reference Structure' and 'Reference type'. Since I am using the structure 'ZBFNEW', it lo

  • How can I output frequency readings of my signals using FFT?

    Hi there, I need help in regard to the topic stated. Currently I have accquired a sine wave with frequency that vary, using one of the accquistion card by NI. I had converted it to a digital signal so that labview can read it. Now, I will like labvie

  • Oracle Portal export Transport Set

    Hye Oracle Portal Guru's I'm using Oracle Portal Version: 10.1.4.2.0 (Build: 197) in Solaris 5.9 may i know, is it we need to do export a transport set every time we want to do a backup of page group. i.e i have a Page Group: My Page. Need i to expor