Link to home
Start Free TrialLog in
Avatar of burnem
burnem

asked on

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
Avatar of blue-genie
blue-genie
Flag of South Africa image

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.
this works:

_root.onLoad = function()
{
    loadMovie(txtImageURL,"image1");
}
ASKER CERTIFIED SOLUTION
Avatar of elhy
elhy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial