Automatically Load Dynamic Image

Posted on 2005-03-15
Medium Priority
Last Modified: 2010-04-03
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 () {

image1.onRelease = function () {

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

Question by:burnem
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 39

Expert Comment

ID: 13543510
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.
LVL 11

Expert Comment

ID: 13553950
this works:

_root.onLoad = function()

Accepted Solution

elhy earned 1500 total points
ID: 13617126
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(){

image1.onLoad = loadUp;

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question