load swf in RAM via an asset manager

Hello.

I have a virtual world of AS3 and we continuously loading external resources such as sovereign wealth funds and the sounds.

Some of my menu screens that darn take a long time to load. Read a tut, who said we should load them into memory vivid using the asset manager.

I'm assuning asset manager is simply a class that is used especially for sounds, graphic and sovereign funds of loading and unloading. The important part is:

What do mean by loading into RAM.

I thought that all SWFs were automatically loaded in RAM IE: cached or is in the flash player or the browser cache. Or what I need to do specifically myself with a code. We import external files, so we thought it was a great idea because they are shared by a lot of games.

BTW: RSL I haven't read but I don't understand. I thought that my external loaded files were RSLS (runtime shared libraries) or I have to do some physical encoding convert in RSL.

It's so important, because I'm not very experienced but I am getting much better because aid receied in this forum and my current programmer leaves me. I studied in As3 and design patterns and I know basic coding a lot better now.

SEE YOU SOON

EDIT: Just read that I am using an http call. -J' use urlloader - well, it's what you use isn't it or how load you an external swf. Just read that you can contain the SWF as a variable that it loads into RAM and therefore will be available immediately. Know that I do not understand something I've ever read anywhere.

Hey,.

I do not now have time to examine it in detail, but it feels like queries are cache busted. This means that they are responsible every time - not used from the cache.

Unless the server is set up on non-cache, there must be something in your code that makes the different URL request every time.

A brief look at your code makes this suspicious line:

_path = path + Home.instance.cacheString;

If the value of Home.instance.cacheString is always different - it is certainly a source of your troubles.

Tags: Adobe Animate

Similar Questions

  • Management of the custom event sent by loading SWF fails

    I loaded and SWF using SWFLoader. Not a component, but just a regular Flash AS3 SWF. I can access its properties and functions but when I listen to a custom, event distributes, I get the error:

    Error #1034: Type coercion failed: cannot convert com.subhumanmedia.classes::SoundCueEvent@911ad61 to com.subhumanmedia.classes.SoundCueEvent.

    Here's the event:
    package com.subhumanmedia.classes
    {
    import flash.events.Event;
    SerializableAttribute public class SoundCueEvent extends Event
    {
    public static const = "cueSound" CUE_SOUND:String

    private var soundCueObjectInstance:Object;

    public void SoundCueEvent (type: String, bubbles: Boolean, cancelable: Boolean, soundCueObject:Object)
    {
    parameter soundCueObject:
    soundCueObject.cueSoundURL is the string with the name of file to play
    soundCueObject.cueSoundStartTime is the number giving the millisecond offset to read from
    //
    Super (type, bubbles, cancelable);
    soundCueObjectInstance = soundCueObject;
    }
    public function get soundCueObject (): Object
    {
    Return soundCueObjectInstance;
    }
    override public function clone (): event
    {
    return new SoundCueEvent (type, bubbles, cancelable, soundCueObjectInstance);
    }
    }
    }

    Here is the statement in the loaded SWF, the event:
    dispatchEvent (new SoundCueEvent (SoundCueEvent.CUE_SOUND, true, false, soundCues [cueCounter]));


    soundCues is an attay soundCueObjects.

    Here is the definition of the listener in my main class:
    slide.slideGraphic.swfObject.content.addEventListener (SoundCueEvent.CUE_SOUND, cueSoundHandler);

    And here's the Manager:
    private void cueSoundHandler(e:SoundCueEvent):void
    {
    trace (e);
    }

    If I change the type of parameter of the event Manager, it does not take a mistake, but I can't yet ride a SoundCueEvent event in order to obtain tracking information.

    Now both the right loaded SWF and main class get the definition of the event from a compiled SWC, but I tried several other ways to do it without any better result.

    I don't know even what causes the error and am totally baffled by how to solve it. Can anyone help?

    It is equivalent to the problem of shared code described in the presentation of the modules on my blog.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Load SWF sound management - issue

    I have a sound problem. I have a flash (swf) loaded into another flash (my main swf) file.

    I want to cut all the sounds in loaded swf. I cut "timeline" sounds (with the loader object soundTransform) successfully, but my problem is with runtime played sounds.

    If the sound is reproduced using actionscript (not manually droped on the stage using the flash and the timeline) and soundTransform does not apply.

    I think I can't use SoundMixer because it would cut my main SWF sound too.

    I worked on it for a week and I would gladly appreciate your help.

    Thank you!

    Yet once, if there is no soundchannel for sound loaded (or other), you cannot control the volume of sound.  You can close the stream if the sound in the loaded swf file is itself responsible and open, but cannot control the individual sounds in the loaded swf file.

    If there is a soundchannel loaded, you can find (using actionscript) and use it.  But if you are unsure if a soundchannel exists, the best you can do is find the sounds, stop them if they are still streaming, restart them with a soundchannel and then cut the.

    but most people can stop just all sounds.  It works for you?

  • Removal of the external loaded swf does not decrease memory

    I'm developing a desktop application using flash builder 4.7, where I am loading swf external swf main, but after his withdrawal, it remains in the process (check in the Task Manager. os: windows 7), process decreases a little, but not as much as it should be. so, whenever I insert again and remove, process increases and after multiple loading, application crash down. I'm removing it like this

    if (_loader.numChildren>0)

         _loader.removeChildren(0,_loader.numChildren-1);

    _loader.unload();

    _loader.stopAllMovieClips();

    _loader.unloadAndStop(true);

    _loader.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);

    this.removeChild(_loader);

    _loader = null;

    I have added custom destroy the external inside swf method and started calling him. I was almost everything, remove (almost say because it might be something I missed, because it's huge project) but still the long process.

    That I created empty swf (new project without code and nothing in it) and tried to integrate and to see what is happening. It was just the same...

    Then I thought again Air SDK may have solved this problem, so I've updated SDK for 19.0.0.207 currently more recent, but still nothing, even if the process now increases above.

    I think that it comes to Flash gc. One of the solutions is to have one and only instance of swf external and removeChild and addChild it whenever you need. It is a bad way to do it. Process will not increase all the time, but in my case I have many SWFs to load and it will slow down my request for computers of RAM low resources it could cause the crash and it is bad to have unnecessary things running in the background process

    so any suggestions are welcome

    No need to stop the video clips and remove... use unloadAndStop() and it will all stop and unload the file... as it is not possible to call the content of charger (clips) stop after the unload method, it is already removed... So, try to use only 3 lines only to unload the file.

  • Calling functions / set variables in loaded SWF

    You know how you can create a Movieclip object, add a function or a variable, and then call this function or change this variable to the SWF file that includes? I want to be able to do it, only with SWFs that are loaded at run time.

    My "main" SWF is just something the type of menu. The user clicks a button in my HAND. SWF and the HAND. SWF and then load the SWF associated with this button, using the AS 3.0 method Loader () - URLRequest () - addChild () that everyone always asks questions on prescribed.

    It works very well. But now I have a few custom and other objects (ie., not only the channels) in my HAND. SWF I want power sharing with the loaded SWF files. preferably, I'd use a function of the type of accessor (ie., LoadedSWF.GiveMeTheCoolObject (MyCoolObject)); Although at this point, I'm willing to hack the object itself (ie., LoadedSWF.CoolObject.CoolField = MyCoolObject.CoolField ;) if that's what it takes.

    I tried to call the functions and setting the fields, but the AS 3.0 compiler doesn't care for this kind of nonsense on its objects defined by the generically. Also note that, at runtime, a call to LoadedSWF.hasOwnObject ("GiveMeTheCoolObject") returns true.

    So my colleagues big brain, what is the magic?

    In advance, thank you for the help!
    Scott

    Kglad,

    Quote:
    Posted by: kglad
    the error message, seems, your function expects a member of the class MyCoolObject, correct?
    and MyCoolObject is not an instance of this class. so, you have to fix that. That is to say, create a member of this class, and use this class as a parameter of the function member.

    Heh, that's what the error message says all right. But the object IS actually an object of class MyCoolObject. I looked at this thing for hours and MyCoolObject IS an instance of this class. I tried different combinations of casting (including the cast on an object and passing that) but had no luck whatsoever.

    So I googled this particular runtime error message ("Error #1034: has no Type constraint: cannot convert '" ") and found a ton of links to other people with a similar problem. As a general rule, the problem was just as you say, someone passes a button as a string, that kinda thing. But a guy had a problem with an object that it has derived from the event class. Once the hours spent trying to make it work, he has tried to override clone() of the base class method and got it to work:

    http://www.assertTrue.com/articles/2006/10/14/custom-events-in-ActionScript-3-0

    As for my project, I took a long, hard look at the overall architecture of my project and decided it would be better if all the 'real work' is held in the HAND. SWF file. This approach would solve some other problems, and it makes sense in a mindset of "separating the display of data.

    If (and this is the interesting part) I changed the API for the LOADED. SWF to accept the pairs of strings (ie., LoadedSWF.AddToDisplay (String Name, String Data)) rather than accept MyCoolObj. Ran and Viola, now we work without any throw exceptions in. After this moment of glory, I created a couple of other APIs that comes from base classes (a type int, the other a type function) agreed and was happily on my way.

    On this basis, I understand while passing another base class objects (IE, the derived class) to load MovieClips via custom function API is... perhaps not so simple you'd expect. In the grand scheme of things well, not a big deal: as far as I'm concerned AS3 rocks.

    Kglad, thanks again for all the help: your comments on how this was the big push that I needed to get through the last barrier of this project.

    For those who read this topic for the ' how to call functions or set variables in a loaded SWF file?

    The short answer is cast to the SWF file that is loaded as a MovieClip content object and then call the function or change the variable:

    Load the SWF file (you saw this code a million times)
    var LoadedSWFObj:Loader = new Loader();
    var MyURL:URLRequest = new URLRequest("LoadThisSWF.SWF");
    LoadedSWFObj.load (MyURL);

    It is within your Event.COMPLETE Manager:

    Cast as a MovieClip object and work with it.
    var LoadedSWF:MovieClip = LoadedSWFObj.content as MovieClip;

    or another way to perform a cast:
    var LoadedSWF:MovieClip = MovieClip (LoadedSWFObj.content);

    Call yer function:
    LoadedSWF.CallMe ();

  • FLASH AS2 main swf loaded swf playback controls

    Hello

    I have two swf files. The main (main.swf) swf that loads another swf (external.swf).

    The current code in my main swf that loads external swf file is:

    Stop();

    this.createEmptyMovieClip ("holder", 1);

    holder.loadMovie ("content/swf/M01/disclaimer.swf");

    The loaded swf file must unload on a click event, then the main swf movie should resume playing.

    The code in the swf file is:

    on (release) {}

    _level0.gotoAndPlay ("hideMSG");

    _parent.unloadMovie("content/SWF/M01/disclaimer.swf",1);

    }

    The external swf file loads and unloads perfectly, but the film does not seem to take over.

    When I try to use _level0.play, it seems to reload and restart the file main.swf.

    Any help would be greatly appreciated.

    Laura

    No, there is no downtime in this context, there is indeed a play(); which is exactly what I want.

    I managed to get it using variables instead of work.

    Thank you

    Laura

  • Weird, click on load SWF event

    Hi, recently I worked on a project aimed at analysing and disseminating the announcement of VAST3. One thing I have to do is listen to the MouseEvent.CLICK on the loaded SWF file.

    I added the charger to a sprite and add the listener of events on the sprite. When I load the following SWF file, the click event is fired only when I click on the bottom. If I click on the logo of the site, no click event occurs.

    If I downloaded the SWF file on my hard drive, everything works fine. The click event can be triggered whenever I click on the ad.

    The SWF file I load has all the embedded assets.

    I want to know what is causing this problem because with some SWF files I can only listen to the MouseEvent.CLICK event on the _loader.content so that some, like the one below, meets partially for click event on _loader.content and _container.

    I simplified the code as shown below.

    package  {
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.net.URLRequest;
       
        public class Main extends Sprite {
    
            private var _container:Sprite;
            private var _loader:Loader;
    
            public function Main() {
                _container = new Sprite();
               
                _loader = new Loader();
                _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
                _loader.load(new URLRequest("http://gtms04.alicdn.com/tps/i4/TB1Fzd.FVXXXXaOXXXXeflbFXXX.swf"));
               
                _container.addEventListener(MouseEvent.CLICK, onClicked);
                addChild(_container);
            }
           
            private function onComplete(event:Event):void {
                _container.addChild(_loader);
                _loader.content.addEventListener(MouseEvent.CLICK, loadedSwfClicked);
            }
           
            private function loadedSwfClicked(event:MouseEvent):void {
                trace("loaded swf clicked"); // When I click on the Logo and the animal
            }
           
            private function onClicked(event:MouseEvent):void {
                trace("clicked"); // When I click on the gradient background
            }
        }
    }
    

    One of my colleagues told me that it has something to do with the issue of security. So I need to make a call Security.allowDomain like this:

    private void onComplete(event:Event):void {}

    Security.allowDomain (_loader.contentLoaderInfo.url);

    _container. AddChild (_loader);

    _loader. Content.addEventListener (MouseEvent.CLICK, loadedSwfClicked);

    }

    And the click on the loaded SWF file will appear correctly.

    Because the bottom layer degraded of the only loaded SWF file contains a Bitmap, which is not an InteractiveObject instance, it will not answer the MouseEvent.CLICK listener on the _loader.content.

  • problems loading swf to a remote server

    Hi all

    I have problems loading SWF to my remote server of Mr. There is no problem loading all my other SWF files just straight up. I get a message telling me that Dreamweaver is having a problem connecting to the remote server and it times out. I can load up the swf using cpanel. Does anyone have advice helping, what happens if something can be done to address the problem

    Concerning

    Paul

    Hi Paul,.

    Use to troubleshoot Adobe: http://helpx.adobe.com/dreamweaver/kb/troubleshoot-ftp-issues-dreamweaver-cs5.html. (cs5 is similar I think).

    BUT in any case I'm not a friend of a detailed diagnosis. This is one of the reasons why I prefer an external FTP program. The difficulties with which we must fight encourage me in this opinion, especially because we are always looking for experts, we charge a 'jack of all trades '.

    For this reason, for example, manage multiple Web sites or download my files and sometimes the reverse, for a necessary download from my server or use a "sync a whole site", I use FileZilla (cpanel I don't even know). It just seems easy for me to keep track of all transactions accurately and generate or easily reflect the desired tree structure.
    First and foremost, FileZilla has a function (translation of my German FileZilla), called 'compare the list of files. Here it is possible to use the time of size or change file as a criterion. There is also the possibility of 'hide identical files', while only those files that you want to redact remain visible.

    And even if it means that you need to install a new program, I am convinced that there is an advantage. Here is the link to get it and where you can read information on how it works:

    http://FileZilla-project.org/ and http://wiki.filezilla-project.org/Tutorial#Using_the_site_manager

    Mac: Mac OS X
    http://FileZilla-project.org/download.php

    Of course, you should also access data to reach your server.

    Good luck
    Hans-Günter

  • CLICK in the main timeline > > will click where is designated in loaded swf?

    Seems doable, but difficult to grasp the concept...

    I have a slideshow loaded swf in this slide show, I assigned "next" and "prev" buttons to promote and save my slide show via the image labels ("avowed") for example... Here is an example:

    btn_next.addEventListener (MouseEvent.CLICK, nextClick);

    function nextClick (e:MouseEvent): void {}
    this.gotoAndPlay ("twoIn");
    }

    I want this function to execute when I click a State hit on the main timeline above him. So, how I would trigger the function above with a click on the State of success in the main timeline?

    To help, here is my code for the mouse over the function using the State of success that refers to the external buttons:

    pNextH.addEventListener (MouseEvent.MOUSE_OVER, nextOver);

    function nextOver (e:MouseEvent): void {}
    var mc:MovieClip = MovieClip (imageLoader.content);
    MC.btn_next.gotoAndPlay ("nextOver");
    }

    Code of THS I gave calls the nextClick() function that is defined in the main timeline of your loaded swf file, assuming nextClick() is in the main timeline and yourloader is the reference of your charger.

  • Duplicate a loaded SWF, no Actionscript?

    Then... by writing a Flash based game, I have the main SWF file and its associated classes at one time, loading a single SWF file that represents a sprite in the game. I want to use this sprite repeatedly in the game, then I've duplicate after loading and expect that it would work. Unfortunately, after duplicate the loaded SWF file, it seems to be ignoring the actionscript timeline such as gotoAndPlay() calls.

    Here is the configuration:

    The loaded SWF that contains the animated sprite has a single layer on the timeline and basically has a number of labeled images dedicated to each animation - that is to say, there is a "walk_east" image, which traverses a character walking East, and at the end of this animation, has a command of gotoAndPlay ("walk_east") on one of the frames that it returns at the beginning of this particular animation to repeat the whole ordeal. The image after this one could be "walk_west" and contain West animation walk, etc. The very first frame of the SWF has a simple "stop()" call in there, so nothing no anime until the main SWF file tells the SWF loaded to do it (via a gotoAndPlay() call). This SWF has a base known as "Actor" document class

    The main SWF load this SWF using a typical loader. Then, to duplicate the loaded SWF file, I opted to do something like that, where the "clip" is a reference to the loaded SWF loader:

    var swfClass: Class = clip.contentLoaderInfo.applicationDomain.getDefinition("Actor");
    var clone = new swfClass();

    I can create any duplicates, I want, no problem. However, as soon as I start playing a (i.e., "clone.gotoAndPlay ("walk_east"), he comes will travel the entire chronology of the loaded sprite / duplicated SWF - ignoring the various actionscript code on the bases that SHOULD it be repetition of the cycle of specific animation I want... and despite the fact that when played, the same SWF does not display this behavior.")

    As well as her duplicate movieclip causes duplicated SWF to lose his actionscript on the timeline?

    Someone at - it ideas? This is expected behavior? I can't imagine this is how it should be - I want to only load the SWF sprite just once, to save bandwidth and then reproduce them as many times I want to in the game. This had to be done before... I can't imagine the developers simply reload the SWF even several times if necessary the same SWF to be used several times - that is to say, several enemies of the same type.

    Or I just do it more difficult that there must be? Help, please!

    RE: "the reason why I use the charger and not simply add the SWF file at the library of the FLA is because the sprites to load are dynamic based on a number of variables and a configuration XML file-driven." The only app knows which fund sovereigns to load at runtime based on things like what level the player entered... »

    OK, so? You shouldn't need a charger for the sprites just because they are built dynamically.
    You can keep all the config in the XML files, but keep the logic in separate classes that are all referenced in the same FLA file. You say "...". sprites to load are dynamic based on a number of variables... "OK, you can not create these sprites for parts that are in your library dynamically by using the operator"new "? Try a different approach, do not get stuck on the technical problem which is most likely a bug in the VM... If it doesn't, just leave it. Try a different approach.

  • Load a new Deskfile via Ole

    Hello

    How can I load a new deskfile via OLE. I tried to set the variable deskfile with tocommand ("deskfile: =...")

    but this has no effect.

    Thank you

    diademi

    Hello diademi!

    Are looking for the 'HKEY_CLASSES_ROOT\CLSID\ {285E4FB2-F633-11D1-85DC-008048D9A408} \StartParameter' path in the registry. 'DesktopFile' and 'DesktopPath' keys, you need to set.

    Matthias

  • connection via windows mobile manager

    Hello.

    I need to update my gps car or when I connect it via USB the manager tells me that it is not connected... What can do. ?
    Hello
     
    Please select your language from the drop-down menu above to post your question in the language of your choice. The forum in which you've posted is for English only. If you can't find your language above, support for additional international sites options are by following the link below:
     
    Thank you
  • Windows XP pro, can not see desktop (just a blank screen) at startup. can access only via the Task Manager. How can I fix? __

    Windows XP pro, can not see desktop (just a blank screen) at startup. can access only via the Task Manager. How can I fix?

    In the Task Manager, click on "File" and select "new task (run).

    Type explorer.exe, and then press the ENTER key.

    If you are able to connect successfully to the windows, scan the entire computer using updated anti-virus software and check the virus.

  • Smartphones blackBerry Apps via BB Desktop Manager installation error

    I get "Invalid Configuration" error every time I try to install applications via BB Desktop Manager. The error tells me that the device has no storage enough for my selections. Here is the screenshot of the error, when only 1 app is checked for installation:

    The machine is new, OTA setup work, and there is a lot of storage space.

    Info on the device

    Carrier: Maxis

    Model information and the version of the OS: Curve 8520 on v4.6.1.286

    Apps and free space

    Free file before and after a battery to remove/replace:

    Front - 104604061 bytes (100 MB)

    After - 120812353 bytes (115 MB) [deleted an application before the reboot].

    A battery pull fix your problem?

    N ° same error has occurred.

    (OTA) installed applications and their versions:

    Messenger of BB - 5.0.1.38

    Facebook - 1.7.0.22

    LinkedIn - 1.1.0.0

    gTalk - 2.5.32

    BlackBerry App World - 1.1.0.33

    Enhanced Gmail Plugin - 1.0.0.59

    Can someone help me out here please?

    Problem solved. Updated BB Desktop Manager for BB Desktop Software and applications can be installed on the wire.

  • VIA a device manager suddenly appeared on my PC.

    via a device manager suddenly appeared on my pc.

    What is it and where did it come from?

    Hello rooster33,

    THROUGH the Device Manager is a software very probably that was installed by the manufacturer of your motherboard, when you installed drivers or software from their website or disc.

Maybe you are looking for