• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Automatically Load Dynamic Image

Hi all-

I'm using the following code to load a dynamic image based off of a php variable that is passed in the <object> tag

==============================
image1.onLoad = function () {
            loadMovie(txtImageURL,"image1");
};

image1.onRelease = function () {
            loadMovie(txtImageURL,"image1");
};
==========================

Here is the issue... the onRelease function works and will swap out the image with the one I want, whereas the onLoad does absolutely nothing.  The script is on the first frame of the movie, so I have tried to make it an onEnterFrame as well as a "root.onLoad" to no avail... any ideas??

Thanks
brendan
0
burnem
Asked:
burnem
1 Solution
 
blue-genieCommented:
from help file. re. onLoad event handler.....


This handler can be used only with movie clips for which you have a symbol in the library that is associated with a class. If you want an event handler to be invoked when a specific movie clip loads, for example when you use MovieClip.loadMovie() to load a SWF file dynamically, you must use onClipEvent(load) instead of this handler. The latter handler is invoked when any movie clip loads.
0
 
BuffonCommented:
this works:

_root.onLoad = function()
{
    loadMovie(txtImageURL,"image1");
}
0
 
elhyCommented:
Saw this statement in the help file: "You must define a function that executes when the event handler is invoked.". Not sure if this is your case but I guess you can try it.

function loadUp(){
          loadMovie(txtImageURL,"image1");
}

image1.onLoad = loadUp;
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now