pragathikanth
03-26-2003, 08:39 AM
Hi All,
I have a problem with onLoad/onData function.
Here’s what I am trying to do. Load a swf file in to an mc (myMC)
and I have this code on main timeline (_root ) to check if the swf is loaded into myMC.
//-------- code------------------
myMC.onData = function(){
trace("File loaded");
}
//I am loading the file on press of a button
// --------- loading image.swf into myMC---------
btn.onRelease = function(){
loadMovie("image.swf","_root.myMC")
}
/*
The above code should work right? some how it does not.
if I write the same thing on a ClipEvent it works.
*/
// onClipEvent check if the clip has recided data.
onClipEvent(data){
trace("File loaded");
}
The reason why I dont want to use onClipEvent is to avoid attaching any code to the MC’s.
Can some one please explain what is the difference between these two methods and how to check if the data is loaded into an MC if I have to write the code on the root.
Thanks for your time.
I have a problem with onLoad/onData function.
Here’s what I am trying to do. Load a swf file in to an mc (myMC)
and I have this code on main timeline (_root ) to check if the swf is loaded into myMC.
//-------- code------------------
myMC.onData = function(){
trace("File loaded");
}
//I am loading the file on press of a button
// --------- loading image.swf into myMC---------
btn.onRelease = function(){
loadMovie("image.swf","_root.myMC")
}
/*
The above code should work right? some how it does not.
if I write the same thing on a ClipEvent it works.
*/
// onClipEvent check if the clip has recided data.
onClipEvent(data){
trace("File loaded");
}
The reason why I dont want to use onClipEvent is to avoid attaching any code to the MC’s.
Can some one please explain what is the difference between these two methods and how to check if the data is loaded into an MC if I have to write the code on the root.
Thanks for your time.