AS3 - Load an SWF (problem)

Hello,
I have to make some kind of an portfolio where I have to load my .swf's and .f4v's I made past year.
My code doesn't make me having errors.
Code:
var request:URLRequest = new URLRequest("bronbestanden/A_AndriessenB_Fotoalbum.swf");
var laden:Loader = new Loader();
laden.scaleX = laden.scaleY = 0.5;
laden.x = 100;
laden.y = 190;
laden.load(request);
addChild(laden);
But when I click the button he loads my .swf's but plays it
very very slow. The fps of both my portfolio and swf is exactly the same. I already put the code
to load my .swf in another new file and there it works very fluently. All my other types of videos (.flv's and .f4v's) also
run without any problem (even though my .f4v-files are bigger than my .swf's) Can anyone help me?
Thanks

// add some preloader entertainment display
var request:URLRequest = new URLRequest("bronbestanden/A_AndriessenB_Fotoalbum.swf");
var laden:Loader = new Loader();
laden.scaleX = laden.scaleY = 0.5;
laden.x = 100;
laden.y = 190;
laden.contentLoaderInfo.addEventListener(Event.COMPLETE.loadCompleteF);
laden.load(request);
function loadCompleteF(e:Event):void{
// remove your preloader display
addChild(laden);
MovieClip(laden.content).gotoAndPlay(1);

Similar Messages

  • AS3 load external swf problem, please help...

    Hey guys, I am really in need of an answer here. I would tremendously grateful if someone has the answer. I'll keep it simple and right to the point:
    1. I have created "index.swf" in AS3. Has it's own "MainClass" class.
    2. I created "holder.swf" which is the main landing page. Has 2 buttons, for the viewer to load the site in fullscreen or standard.
    3. In the timeline of "holder.swf" I have created 2 frames, 1st frame containing the buttons, second frame containing the AS3 external swf loader script.
    It does not seem to want to load my "index.swf".
    I have tested a million different ways, it load other swf's just fine, AS2 and AS3, but for some strange reason it just will NOT load "index.swf".
    This is driving me crazy, I have a feeling it has something to do with a class conflict. I have tried (import MainClass;) in the first frame of "holder.swf" and no luck.
    PLEASE GUYS, LET ME KNOW IF YOU KNOW THE ANSWER!
    THANK YOU SO MUCHO.
    Michael

    Hey kglad,
    Thanks for the quick reply!
    Well here is the problem... With the exception of a few things I need to update, as well as implementing some better preloaders etc... the site is running alright...
    About a week ago I decided that I wanted to site to start with the above landing page. A simple "holder.swf" which would give the viewer something to look at before entering the site... (ideally I want to find a script that will begin loading "index.swf" while the viewer is still on "holder.swf", but I'll figure that out later).
    Anyhow, I created "holder.swf" as I have many times before, and for some reason it does not seem to want to load "index.swf" into the second frame when instructed to do so... does that make sense?
    So... ideally I would like the site to start on the above graphic, then once the button is clicked, "index.swf" opens up...
    It's driving me crazy, because my code works on other swf's I've tested it with, just not with index.swf, which leads me to believe there is something in the MainClass.as file which is causing it not to load...
    What are your thoughts?
    Oh, and many thanks again!!!
    M

  • Fiexed! AIR 3.7 on ios load packaged swf problem

    I have fixed this, thanks. It's because this:
    <mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
    output="${OUTPUT_DIR}/${APP_NAME}.swf"
    static-rsls="true" It's the problem
    accessible="true"
    configname="air"
    debug="${DEBUG_FLAG}"
    failonerror="true"
    fork="true"
    maxmemory="512m">
    Hi, nice guys
    Thanks for your time to watch my proble!
    I'm develop IOS App by AIR 3.7. I have seen this about load swf http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air- apps-on-ios/  . Everything works fine in debug mode, but when I release it , everything is gone.
    I'm using AIR 3.7 in GPU renderer mode, and load SWF with some code. I have add LoaderContext.
    var l:LoaderContext=new LoaderContext(false, ApplicationDomain.currentDomain);
    l.allowCodeImport=true;
    When I debug in Fast mode, everything is ok, in Standard mode package get the Errors:
    Error occurred while packaging the application:
    java.lang.NegativeArraySizeException
              at com.adobe.air.ipa.SWFUtils.read(SWFUtils.java:205)
              at com.adobe.air.ipa.SWFUtils.inspect(SWFUtils.java:250)
              at com.adobe.air.ipa.SWFUtils.<init>(SWFUtils.java:181)
              at com.adobe.air.ipa.SWFSplitter.main(SWFSplitter.java:68)
    Exception in thread "main" com.adobe.air.InvalidInputException: Invalid input. Not a valid swf file
              at com.adobe.air.ipa.SWFSplitter.main(SWFSplitter.java:105)
    Compilation failed while executing : ADT
    When I use a empty project to load a test swf, get the Error:
    Main Thread (Suspended: Error: Error #3747: Multiple application domains are not supported on this operating system.)
    Anybody know how to fix this ?
    Thanks!

    i have same problem. but i did not understand where is this code? where should i look?
    """<mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
    output="${OUTPUT_DIR}/${APP_NAME}.swf"
    static-rsls="true" It's the problem
    accessible="true"
    configname="air"
    debug="${DEBUG_FLAG}"
    failonerror="true"
    fork="true"
    maxmemory="512m">""""

  • Loading External SWF - Problem

    Hi,
    Using MovieClipLoader I want to load external SWFs - and it
    is working fine
    if external swf doesn't have anything outside it's stage,
    otherwise it shows
    everything - that's the problem.
    For example, external swf's stage dimensions are 100x150, but
    it has some
    timeline animation (some objects scrolling through the stage,
    some bouncing
    text animation that sometimes goes off-stage, etc..).
    So when I load this external movie (banner.swf), I can see
    all these objects
    that were bouncing outside this 100x150 area (the stage of
    banner). Even
    more - the size of loaded movie is larger than 100x150px
    (because of these
    off-stage objects that are now visible). This way I'm getting
    positioning
    problems, too.
    var mcl:MovieClipLoader = new MovieClipLoader();
    mcl.loadClip("banner.swf", holder);
    mcl.addListener(listener);
    holder._x = Stage.width/2 - holder._width/2;
    holder._y = Stage.height/2 - holder._height/2;
    Thanks in advance,
    B.

    Hi kglad,
    Does doing that takes only into account width and height of the stage, or also considers off stage items (as in the initial question)?
    I am also looking at this issue and we can't have all the content providers modify their pre-existing flash applications to be displayed in the appropiate scale. We are looking to any of the following:
    find a way to get adobe air/flash to not consider the off stage elements on the width/height we set to the movie.
    find a way to get the stage size from the external movie and use that to auto calculate the resize needed.
    any other alternative that allows to have the same end result, which is loading up the external content at the size we specify and displaying well. We can actually hide content outside the stage, but we still need to know the appropiate scale / size to apply to the movie so what's visible matches the are where we want to show the content.

  • AS3 loading external swf files with buttons from inside a movieclip

    In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame.
    On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
    Do I add event listeners on the last frame of mc_1 for each button?
    how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
    So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.
    any help?

    The code for that button's event listener needs to be placed wherever it has direct access to the button.  Not necessarily on the same timeline, but in a place where both the button and the code are present at the same time.
    The code could be placed at the frame in the main timeline where the movieclip with the button(s) is, targeting the buttons via the movieclip (mc.button.addEvemtListener...) , unless the buttons are somewhere down the timeline of that movieclip.
    If they are down the timeline of that movieclip, then you would need to have the event listener also inside the movieclip, down its timeline where the buttons are finally settled in... being sure to assign instance names to the buttons at every keyframe.

  • Loading external swf problems

    iv recently started learning as3 and have made a flash site
    using it which all works fine. iv used an online tutorial to help
    create a dynamic slideshow/photo gallery which again works fine.
    But when i try to load the external slideshow/gallery into a
    movieclip it dosnt work and i get this error:
    TypeError: Error #1009: Cannot access a property or method of a
    null object reference.
    im pretty sure its because the code used in the main flash
    file is on the timeline and the code in the external file to be
    loaded in is in an external as file.
    any suggestions on a way around this?
    the code im using to load the external flash file is:
    toload.load(new URLRequest("newfile.swf"));
    photography.buttonThumb.addChild(toload);

    no sorry forgot the 1st line
    var toload =new Loader();
    the loader works fine when loading jpegs and swfs with no
    actionscript

  • 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
    >

  • Problem loading one SWF into another in Flash AS3

    I am trying to load an SWF file in another SWF file. The child SWF file works fine when run standalone like if I set visibility of an item to true or false, it works fine. But when the SWF is loaded into a parent SWF, I am not able to execute such commands, neither I get any errors...

    are both swfs as3 swfs?
    is the code in the loaded swf and is that code referencing objects in the loaded swf?

  • Problem in loading secondary swf

    Hi,
    I am trying load a font as swf for IOS application.i tried load to it from both application directory and application storage directory.but it always throws the following error.
    Fast debuging mode everything works fine.
    Air Sdk 3.8
    Flash Builder 4.7
    swf version 20
    Error 3747: Multiple application domains are not supported on the operating system.
    Code i used to load the swf.
    var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain,null);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fontLoadComplete);
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    var strPath:String = "assets/fonts/font.swf"
    var urlReq: URLRequest = new URLRequest();
    urlReq = strPath;
    loader.load(urlReq, context);
    please correct me if i am doing any thing wrong in loading swf with as3 code.
    Regards,
    Saravanan

    Hi Nimit,
    Sorry for late reply.
    Actually problem is in my side.I am loading two swfs one with code in side another without code.
    I used loader content for only swf containing code inside but both the swfs requires to specify the loader content to same application domain.
    Its working fine after set the loader content to both swfs.
    sorry for trouble and thanks for the response.
    Regards,
    Saravanan.G

  • AS2 swf problem under AS3 swf (probably Tweener problem)

    Hello. I have this problem for a days and it hasn't been soluted yet although I put it on couple of forums. I have 3 files: test.fla, file_as2, file_as3.
    The test.fla file is a typical Loader, which loads external swf files and shows them on the screen. After any key is pressed, the swf is deleted from the screen and loaded again.
    The file_as2 and file_as3 are the AS2 and AS3 compiled having a simple square animation (6 squares fading in from alpha 0 one by one) animated by caurina Tweener. If the file_as3 is compilated and loaded externally there is no problem (six sqares are fading in, after pressing any key the vanish and appear (loaded) again and again...). But if the swf as2 file is loaded, it shows the squares only once and after pressing any key and loading it again, it doesn't shows it at all.
    I guess it's Tweener problem, because when i trace it in AS2 file (onUpdate) it traces only at the beginning.
    How it's possible, that AS3 somehow stops all Tweeners in 2nd time loaded AS2 file?? How to fix it?? Sorry for my english, i left a link for these 3 files to find solution. Try it (test.swf) and then change path inside fla to load AS2 file... Thanks for any ideas.
    Link to download: http://www.filolozka.pl/zip/file.ZIP

    Instead of reusing the same Loader, try loading the AS2 movie multiple times using different Loader instances. Instead of using event listeners like normal, this should be easy to do because you can addChild each Loader instance, and when it is loaded it will automatically play. If you are able to load the AS2 movie multiple times at once and have it work for you, then the problem must be in the way that you removing the old movie, and reusing code to load the movie again.

  • Flash cs4 mac - Error opening URL '/:Users:someting.swf' - Not a "loading external content" problem

    Hello.
    I am having a weird problem when trying to test a movie or publish preview -> flash on mac with Leopard os.
    The result is a blank movie with the usuall "movie not loaded" if u right click on it and the output returns the "Error opening URL 'the path of the swf here'.
    This has nothing to do with loading external files or something like that. It happens even in blank movies and it gives the same error if I try to open a swf from flash ide.
    I can publish the project or export the movie with no problem at all.
    I can preview the movie in html. I can run all the swf files in my hard disk, network, usb stick, dvd etc., but when I try to open any of these files from flash ide I got that stupid error.
    Its not something that stops me from working in flash ide but its slow to export movie any time I want to test it.
    Things that I've tried so far but nothing worked:
    Update the flash cs4 to the latest version
    Update the flash players
    Restored the release flash player as default player (I am using as default the debug player)
    Cleared the preferences
    Move the flash cs4 folder to another location in hd
    Saved the fla document first before testing the movie (in different places with or without spaces in document name or folder)
    Give read & write permissions for everyone for flash.app, players and for fla files when saved first before test movie
    Unistall and install the application 3-4 times.
    Test every as version just in case.
    Also I've checked the folders when testing movie and I can see that it creates an swf file, which I can run it outside flash ide (the one that the flash ide player cannot load) with no problem.
    The mac os has the default set up as it came. Nothing chnaged in permissions or security settings.
    Thanx in advance.

    In this particular example I am using this code to start the
    xml file load:
    // now load the XML file that contains the content strings
    var sXMLFile:String = "xml/home.xml";
    var xmlContent:XML = new XML();
    xmlContent.ignoreWhite = true;
    xmlContent.onLoad = onXMLLoadComplete;
    xmlContent.load( sXMLFile );
    But I don’t think the code is the problem here . This
    happens on every file I load when I am using a relative path to the
    content, regardless of how I load the content (XML object,
    loadMovie, MovieClipLoader, etc…) and the same code executes
    perfectly on every other machine in the office(Mac and PC).
    I’m more concerned with the semi-colons and .swf filename
    that Flash is putting into my relative path on the error message.
    Is that normal?

  • 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/

  • HELP PLEASE - loading external swf scale problem

    I have a Flex 3 Actionscript Project. Basically all it does it take some flash vars, set the sound volume,  and load an external swf using a loader and add the loader as a child. The problem is I want the loaded external swf to be scaled to fill the entire stage, even if it distorts it, and that doesn't seem to be happening.
    I really need to resolve this. ANY HELP APPRECIATED.
    Marcus

    Thanks for the reply!
    Here's basically what my code looks like (note: I cut some stuff out that wasn't relevant for the sake of clarity).
    private var swfLoader:Loader = null;
    public function MySwfContainer()  
        stage.scaleMode = StageScaleMode.EXACT_FIT;
        stage.align = StageAlign.TOP_LEFT;
        var request:URLRequest = new URLRequest(swfUrl);
        swfLoader = new Loader();
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,SWFLoader_Complete);
        swfLoader.load(request);       
    private function SWFLoader_Complete(event:Event):void
        addChild(swfLoader);
    What I am observing is that if a swf larger than the stage area is loaded it clips it rather than scale it down and make it fit.
    Marcus

  • Problem when load more swf files work with xml files into my movie

    hi ;
    I have one flash file & more of swf files which work with xml files .
    when I load one swf file into my flash file  and remove it and load anther one on the same movieclip in my flash file it load the old swf file.
    when i load one on movieclip and remove it and load anther swf  on anther movieclip the file doesn`t work  and stoped.
    when test my flash file to load and remove swf files without xml file it work fine but when repleaced the swf files with other work with xml files the problem hapend.
    thanks;

    YOu should trace the names of the files that are being targeted for loading to see if they agree with what you expect.  If you want help with the coding you will need to show the code that is relevant to your problem (not all of it)

  • AS3 Loading problem

    Hello All,
                 I have written a simple AS3 Code to load a SWF File on he Stage. The file is loading properly but the Within the stage. The Width and height of the SWF file change. Like LoaderInfo return file size 200X200 , but after adding child the Width and height changes to 150.23 X150.23. I'm accessing the length of the loader.content property. At what ratio the change is a happening? I have attached the code...  Document property show content radio button clicked.
    stage.scaleMode=StageScaleMode.EXACT_FIT;
    //stage.scaleMode=StageScaleMode.NO_SCALE;
    //stage.scaleMode=StageScaleMode.SHOW_ALL;
    var Clip:Loader = new Loader();
    var req:URLRequest=new URLRequest("1.swf");
    Clip.contentLoaderInfo.addEventListener(Event.INIT,initListener);
    Clip.contentLoaderInfo.addEventListener(Event.COMPLETE,LoadingDone);
    Clip.load(req);
    var info:LoaderInfo;
    function initListener(event:Event):void {
         var SwfClip:Loader=Loader(event.target.loader);
         info=LoaderInfo(SwfClip.contentLoaderInfo);
         trace("File properties :- \n" + "width :- " + info.width + "\nHeight :- " + info.height);
    function LoadingDone(event:Event):void {     
         this.addChild(Clip);          
         trace(Clip.width + "  " + Clip.height + " " + (event.target.content).width + "  " +(event.target.content).height);

    You have stage.scaleMode set to EXACT_FIT which is causing the container to scale... and causing the loaded swf to scale as well. Remove that, or use No_SCALE and it will return the proper size.

Maybe you are looking for

  • How do I save an email address to my contact list?

    I receive an email of importance and would like to know the easiest way to save this address to my contact list.

  • My G4 won't detect an expansion USB

    Hey all- Looks like alot of us early adopters are on the boards tonight. Here's my problem; I did a clean erase and install on my G4, and everything is pretty good so far. however my G4 can no longer read several of my devices I use (Scanner and tabl

  • Extremely hot graphic processor

    Hey Apple fans; I did a number of searches on the boards but the closest I came, the thread was ultimately lost. Anyways, I recently got a 12" powerbook, still has 512 ram and the tempertures to my surprise have been very decent dispite what pre-purc

  • Re: Satellite A - Saving files after recovery?

    Hi friends, I made a mistake. I wanted to setup SP2 for Vista but I lost my all files. I did not understand it has not do this :( Recovery program formatted my second HDD partition. So I am waiting your advices:( thanks

  • Eliminate Guest Logins

    Does anyone know how to eliminate the guest login in Lion? Want no guest logins (including Safari only). Would prefer not showing Guest in the login list.