Reusing dynamically loaded movies

Hello,
I am trying to reuse a dynamically loaded movie which has
been loaded with a movie clip loader. The movie loads fine and can
be displayed once with no problem. However, I would like to be able
to store this movie so that it can be resused again without loading
it from the URL again. Is there a way to do this?
I found this in the docs:
quote:
the problem w/ attachmovie is that one must have a link
identifier (in linkage panel) in order to attach it.
there is no way (that i know of) to attach a *dynamically*
created clip - either by duplicateMovieClip or
createEmptyMovieClip.
I'm hoping this isn't true. What if I had a JPG I loaded
dynamically and I wanted to use it 100 times? I can't imagine
having to load the JPG 100 times.
I need something like attachMovie(), but that only works with
movies that are already in the library. Does anyone know if there a
way to reuse a dynamically loaded movie? I've tried all sort of
combinations of createEmptyMovieClip, duplicateMovieClip, and
attachMovie but nothing has worked.
FYI - I am using Flash 2004 MX Pro and ActionScript 2.0.

yes, load it 100 times. it will be retrieved from the user's
browser cache after the first time so this is not the limitation
you're thinking it might be.

Similar Messages

  • Dynamic load of images in to established Timeline effect

    Is it possible to dynamicly load images in to an already
    established timeline effect?
    Steps I've done.
    Stuffed a JPG in to the library by draging and dropping it in
    to the SWFs library.
    Dropped the JPG on to the main stage
    Right clicked the image then going down to Timeline effects
    and choosing an effect.
    Completing any changes in effects dialogue box and then
    clicking OK.
    Play the movie, and pat myself on the back that it worked.
    So then, how can I get Actionscript to load an image
    dynamically in to that same Timeline effect and have it do the
    effect to that instead of the one found in the library?
    I'm using Flash MX Professional 2004.

    hii
    Can u mention the error message getting while the status become RED??
    As what I understand, this may be the issue of invalid characteristics inPSA Data Records or also there may be records that does not support the lower case or upper case data.
    So just check the data in PSA Level
    Thanks
    Neha

  • Dynamically Loading Slide Show...

    hello everyone
    this is a big one...but i am stuck!
    i want to make a slideshow in flash 8 with the following
    properties...
    1/ dynamically loads jpegs from an external folder and
    centers them on the stage (regardless of whether they are
    landscape/portrait)...this bit i can do
    2/next/prev buttons (also i can do)
    3/ play/stop buttons (this is tricky as versions i have been
    working on don`t have time to load the image before the playhead
    moves on...therefore i need some kind of actionscript which tests
    if the jpeg has loaded, waits for *** seconds then goes to the next
    frame...)
    4/ it has to be re-usable (i want it so that the images are
    loaded as img1.jpg, img2.jpg...then when i want to edit or re-use
    the show i can alter the amount of images and flash will look for
    the last loading image then loop back to the first.
    i knoe this is a big ask but if anyone has the time to help
    me out i would really appreciate it
    thankyou

    Hope, this is not so big !
    But, if you are using the loadClip instead of loadMovie, you
    can trace out the loading process of each images. So that, when an
    image get loaded, you can start the counter by "setInterval". This
    will turn aging for all the dynamicall images has been
    loaded.....

  • Remove loaded movie after new loadMovie has been loaded

    i need to unload a movie once the new loadMovie is fully
    loaded because once i click on my button to do so, my current
    loaded movie goes away & the screen is white until the new
    loaded movie is loaded. (i hope that made sense)

    well I've done it a few ways successfully.
    The most recent, I dynamically create new movie clips.
    see ---
    http://www.13studios.com/erin
    --- Its a figurative painter's portoflio, so while its oil paint it
    is perhaps a bit [NSFW].
    Anyway, the panning effect kinda killed my normal process, so
    when you click a new button, it goes like this...
    PSEudoCODE
    //tickerVariable is defined on frame 1
    holder.create a new movie clip with name "something +
    tickerVariable"
    play preloader(tickerVariable);
    on completion of preloader {
    holder[something+(tickerVariable-1)].unloadMovie();
    //do anything else you need to do
    tickerVariable++
    I hope I didn't just make that more confusing.

  • How to name a dynamically loaded swf

    heres my prblem i have a set of button buried inside a mc
    when they are clicked i need them to call upon a external mc. ive
    tried some different code but nothing works.
    _level0.contholder_mc.contractor_mc.gotoAndPlay() works but
    only one time. if i click on another button and then go back to the
    external mc i gives it another instance name. how do i stop it from
    giving dynamic instances names.
    thanks for the help

    General Flash procedure is to always code you movies separate
    from one another. If the movie is external, all its methods,
    actions and symbols should be embedded inside that movie.
    Basically, get the buttons working in the smaller movie first. Once
    they are doing what you want them to there, move over to the main
    movie and test playback from there. Often times, there will be
    minor changes necessary to an object or button to insure proper
    playback in the main movie but they are more manageable if they are
    resident to the loaded clip. So start by getting your buttons
    working within the loaded movie's fla file then move over. That
    should help you tremendously.

  • Can't target main stage from dynamically loaded swf...

    A part of the Flash app. I'm working on right now does the following -
    Main stage loads an external swf using the following function:
    function loadAsset(evt:String):void{
    var assetName:String = evt;
    if (assetName != null){
      var assetLdr:Loader = new Loader(); 
      var assetURL:String = assetName; 
      var assetURLReq:URLRequest = new URLRequest(assetURL); 
      assetLdr.load(assetURLReq); 
      assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded) 
      assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);  
      function loaded(event:Event):void { 
       var targetLoader:Loader = Loader(event.target.loader); 
       assetWindow.addChild(targetLoader);
    The externally loaded swf loads another external swf into itself using the following function:
    function loadQuiz(evt:String):void{   
    var quizName:String = evt;
    if (quizName != null){
      var quizLdr:Loader = new Loader();
      var quizURL:String = quizName;
      var quizURLReq:URLRequest = new URLRequest(quizURL);
      quizLdr.load(quizURLReq);
      quizLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)       
      quizLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayQuizLoaderProgress); 
      function loaded(event:Event):void {
       var targetLoader:Loader = Loader(event.target.loader);
       quizWindow.assetLoader.addChild(targetLoader);     
    Everything loads fine, but from the quizWindow.assetLoader.addChild(targetLoader) level, I want to send a message/fill in a dynamic text box on the Main Stage. I have been "parenting" my brains out and I'm not sure how to communicate with that level.
    can anyone show me the proper path or method based off the above, or have a suggestion?
    Cheers,
    ~Chipleh

    Andrei1,
    Thanks again for your help. I was finally able to get the solution you posted below to work for me.
    Much appreciation,
    ~Chipleh
    "In your loaded movie write:
    function traceMyself(e:MouseEvent):void{
         dispatchEvent(new Event("I_WANT_TEXT"));
    function writeText(text:String):void {
         xmlFileName1.text = text;
    In the top movie that loads external swfs something like that:
    loadedSwf.addEventListener("I_WANT_TEXT", onTextRequest, true);
    function onTextRequest(e:Event):void {
         Object(e.target).writeText(tQuizXmlFile1.theQuizXmlFile.text);
    This way these two entities are independent and, most importantly, don't care who is the parent or grandparent."

  • Dynamically loading images: UI Loader issue

    I posted this last week, but did not show good examples to get help. Admittedly, I am new to flash, so this may be a bit elementary, so my apologies in advance. I am trying to dynamically load images through the UI Loader component. Attached are the errors I get, and although I think that the coding is close to correct, when I publish, it just flashes up then restarts the movie... any ideas? Thanks in advance.

    there's a problem attaching things to this forum.  so, nothing is attached.
    can you copy and paste your error messages to this forum?

  • How to dynamically load images into Flash

    I have a movie clip on the stage that I want to dynamically
    load images into (that constantly change), how would I go about
    doing this? Thanks.

    Use the Loader class to load in images.
    Then use addChild to add the Loader class into your MovieClip
    on the stage.
    As far as "constantly change" what
    do you mean by that? You could use setInterval, ther enterFrame
    event, or any other means to trigger a new image to be loaded into
    the Loader instance.
    Finally, you can use the Tween class to create some nice
    effects for the images (fade it, blur in, photo blend, masks,
    etc)

  • Message from loaded movie

    I have loaded a movie (test.swf) into movieClip:
    var ldr:Loader = new Loader();
    ldr.load(new URLRequest("test.swf"));
    addChild(ldr);
    The code above is in the movieClip.
    Now I would like to "send" a message from the loaded movie to
    the main timeline of loading movie. I have a dynamic text field in
    the main timeline named messageText. I have tried command
    root.messageText.text = "something" but this doesn't work. What
    should I do?

    Thank You for your answer but it didn't work. Anyway I got it
    working with this:
    MovieClip(parent).parent.root.messageText.text =
    "Something";

  • Changing a dynamically loaded MC

    I have a TargeMC that i load another .swf file into. is it possible to have a button inside the loaded .swf that changes TargetMC swf file.
    sence it is dynamically loaded i dont know how to referance it from the loaded movie inside.

    No i need to have the the .swf file replace itself with another not move the time line. and as far as i know its all AS3...
    this code is on a button in the main document:
    this.addEventListener(MouseEvent.CLICK, servClick);
    function servClick(e:MouseEvent):void
    this.gotoAndStop("down");
    root.TargetMC.removeChildAt(1);
    var myLoader:Loader = new Loader();
    root.TargetMC.addChild(myLoader);
    var url:URLRequest = new URLRequest("ServicesTemplate.swf");
    myLoader.load(url);
    I have 3 more buttons with in the .swf that it loads
    just wondering if i could use those 3 to allso replace the "TargetMC" that there already loaded in to.

  • Using load movie and load variable

    Ok i am having a problem with my movie... when i test it
    using test movie it is fine but when i preview in HTML or run the
    SWF on it own i am having a problem... and i spotted the items i am
    having a problem with but problem is i dont know why.
    i am loading a movie dynamically in my main movie using load
    movie
    loadMovie("menu.swf",_root.i_dress2.i_content);
    and in the actual movie menu.SWF i am loading a text
    dynamically using loadvariable... but i am actually loading it into
    the movie that has already been loaded into my main movie... maybe
    it i will make sense when you see my line of script that is in the
    menu.sef movie....
    loadVariables("menu.txt",_root.i_dress2.i_content.arg.maskedText.scrollpage);
    so i guess it is like i am loadingthe txt into the text file
    after it is loaded into the main movei so that is why it is
    referring ot the text field that way...
    anyway it works fine when i go thorugh test movie but when i
    preview in HTML the text doenst come out...
    am i doing this thewrong way.? is there something i am
    missing?
    Thanks...any help will be appreciated!!

    You may be hitting a Flash 8 security issue that you cannot
    load external
    data using file:////path_to_your_movie/youmoviehtml in a web
    browser. You
    may need to use
    http://thedomain.com/yourmovie.html.
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "batgirl_Sa" <[email protected]> wrote in
    message
    news:e2v04c$lq$[email protected]..
    Ok i am having a problem with my movie... when i test it
    using test movie
    it
    is fine but when i preview in HTML or run the SWF on it own i
    am having a
    problem... and i spotted the items i am having a problem with
    but problem is
    i
    dont know why.
    i am loading a movie dynamically in my main movie using load
    movie
    loadMovie("menu.swf",_root.i_dress2.i_content);
    and in the actual movie menu.SWF i am loading a text
    dynamically using
    loadvariable... but i am actually loading it into the movie
    that has already
    been loaded into my main movie... maybe it i will make sense
    when you see my
    line of script that is in the menu.sef movie....
    loadVariables("menu.txt",_root.i_dress2.i_content.arg.maskedText.scrollpage);
    so i guess it is like i am loadingthe txt into the text file after
    it isloaded into the main movei so that is why it is referring ot
    the text fieldthat way... anyway it works fine when i go thorugh
    test movie but when i preview inHTMLthe text doenst come out... am
    i doing this thewrong way.? is there something i am missing?
    Thanks...any help will be appreciated!!

  • Load movie clip

    Whenever I load a movie clip into the target and test my
    movie, the loaded movie clip always loads in the bottom right. I
    think this is a registration error but I am not sure how to fix it.
    My target is 835px by 635px, same as the movie clip I want to load.
    Any help would be much appreciated.

    Position the blank movie clip in the top left corner where
    you want to have
    the external movie clip loaded.
    Note that if the external movie clip has dynamic content
    creation via AS or
    different content size on higher numbered frames you may find
    it will show
    content to the left and top of the blank movie clip because
    initial size is
    not detectable. In particular if you are loading Flash movie
    that you
    created that you used a third party tool such as xCelsius. In
    this case you
    need to MovieClipLoader and once the onLoadInit event fires,
    manually
    position the blank movie clip which is passed as an argument
    for coding
    convenience.
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "northstar_86" <[email protected]> wrote in
    message
    news:e27cer$5i2$[email protected]..
    Whenever I load a movie clip into the target and test my
    movie, the loaded
    movie clip always loads in the bottom right. I think this is
    a registration
    error but I am not sure how to fix it. My target is 835px by
    635px, same as
    the
    movie clip I want to load. Any help would be much
    appreciated.

  • TotalFrames of dynamically loaded swf

    I've been trying for 2 days now to find the total number of frames of a dynamically loaded .swf.
    Here's an example code:
    var loader:Loader = new Loader;
    loader.load(new URLRequest("mop.swf"))
    master_mc.addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, xmlLoadedF);
    function xmlLoadedF(event:Event):void
        trace(loader.content.totalFrames);
    I am truly puzzled.
    Any help would be greatly appreciated.

    I think this might be complicated by loading an AS2 movie into an AS3 document.
    The error message is telling you that there is no totalFrames property and in fact AS2 movies would have a _totalframes property.
    So you could try that.
    Also I'm not sure if event.currentTarget.content returns a MovieClip or a DisplayObject. If it is a DisplayObject (which is most likely) then it too wouldn't have  totalFrames property. So you might need to cast it as a MovieClip. Something like this:
    MovieClip(event.currentTarget.content).totalFrames
    And or it could be some combination of these two above issues? I don't know really, I'm just grasping at straws. But I don't see any way to know when a clip is done playing other than to compare its currentFrame to totalFrames.

  • DuplicateMovieClip with externaly loaded movie

    Hi
    the function duplicateMovieClip gives me a real hard time.
    I dynamically load certain parts of my application using the
    MovieClipLoader, then (when the external movieclip is completely
    loaded and intialized) I try to duplicate this movieclip using the
    duplicateMovieClip function, but it doesn't work.
    Using the function on a movieclip that has been created at
    design time or using createEmptyMovieclip work, but not with the
    externaly loaded ones.
    Is this some kind of security problem? How can it be solved.
    Any help is appreciated.
    Thanks in advance
    Paul

    quote:
    it will need to be in a flash library.
    Does this mean it needs to be in _a_ flash library or in
    _the_ flash library of the main movie?
    In other words, could I mark the part of the external
    movielcip to be exported as actionscript variable and then use it
    with duplicate movieclip in the main movie? or is there any
    workaround to achieve the goal of having externaly loaded parts of
    an application to be duplicatable?
    Right now I do another loadMovieClip for every instance of
    the layout part instead of duplicating the previously loaded one. I
    guess as long as caching is enabled in the surrounding browser this
    is not a big problem, but if the cache is turned of I guess this
    solution will result in a lot of traffic slowing the application
    down.

  • Use flash player ActiveX component to load movie from resource

    How can I use a Flash Player 9 ActiveX component to load
    movies into my application from program resources.
    Thank you in advance.

    try this:
    // Load text as variable and assign it to the
    // dynamic text field
    var features_lv:LoadVars = new LoadVars();
    features_lv.onLoad = onText();
    features_lv.load("safetyFeatures.txt");
    function onText(success:Boolean) {
    if (success) {
    myText_txt.text = features_lv.safetyfeatures;
    } else {
    myText_txt.text = "unable to load text file.";
    or this
    // Load text as variable and assign it to the
    // dynamic text field
    var features_lv:LoadVars = new LoadVars();
    features_lv.onLoad = function(success) {
    if (success) {
    myText_txt.text = features_lv.safetyfeatures;
    } else {
    myText_txt.text = "unable to load text file.";
    features_lv.load("safetyFeatures.txt");

Maybe you are looking for

  • How to process a transaction where a customer needs an Item on Trial basis?

    How to process a transaction where a customer needs an Item on Trial basis. It essentially means that the item should not move to customer's stock. It still has to be the part of inventory valuation. Couple of options i tried out but i did not find t

  • How to create a DBlink from oracle database on unix to sqlserver

    Hi I need to create a database link from oracle database on solaris machine to sqlserver database.I found that the database link cannot be created from oracledatabase 10g to microsoft sqlserver.So i am planning to go for another windows server where

  • TS4436 how do I find out the day I took a picture

    how do I find out the day I took a picture?

  • Message in OO ALV Grid

    Hello, I have implemented an output display using OO ALV grid. At the point of data change I check the entered data and issue a message if necessary. after the message is issued the program exits immediately at any type of input(double click, enter e

  • How is the attendence marked .

    Hi all How is the attendence marked when we are using the access card system in the company. The question here is do the last in and last out accessed at the company enterence in one perticular day is considered or if we take a break of few minutes o