I keep getting them, and can't figure out where or why I'm getting them.
Here's the full error reports:
ReferenceError: Error #1065: Variable EverybodyEditsBeta is not defined.
at global/flash.utils::getDefinitionByName()
at Function/<anonymous>()
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Function/<anonymous>()
I get the Argument error over a hundred times. It's exactly the same.
What can I do?
Attempting to launch and connect to Player using URL C:\Users\Administrator\Documents\mygame._v55\~mygame._v55.swf
[SWF] C:\Users\Administrator\Documents\mygame._v55\~mygame._v55.swf - 902206 bytes after decompression
ReferenceError: Error #1065: Variable EverybodyEditsBeta is not defined.
at global/flash.utils::getDefinitionByName()
at Function/<anonymous>()[C:\Users\Administrator\Documents\mygame._v55\l oader.as:28]
Cannot display source code at this location.
My apologies for not posting any code. I only just realized what part was causing first error.
package
{
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class loader extends MovieClip
{
public function loader()
{
var loader:preloader;
loader = new preloader();
loader.masker.scaleX = 0;
loader.x = 17;
loader.y = 180;
addChild(loader);
addEventListener(Event.ENTER_FRAME, function (event:Event) : void
{
arguments = null;
if (stage.loaderInfo.bytesTotal != 0)
{
loader.masker.scaleX = stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal;
if (stage.loaderInfo.bytesLoaded == stage.loaderInfo.bytesTotal)
{
removeChild(loader);
nextFrame();
arguments = Class(getDefinitionByName("EverybodyEditsBeta"));
addChild(new arguments);
removeEventListener(Event.ENTER_FRAME, arguments.callee);
}
}
return;
}// end function
);
return;
}// end function
}
}
This is one of the vivid examples of why one should never use anonymous functions.
arguments refers to the arguments passed to function. Why do you nullify event?
Here is docs for arguments:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/arguments.ht ml
I've read through the docs, but it doesn't help me much with my problem.
What I need to know is why won't it recognize EverybodyEditsBeta?
Here's my current code and error report:
package{
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class loader extends MovieClip{
public var arguments:Class;
public function loader(){
var loader:preloader;
loader = new preloader();
loader.masker.scaleX = 0;
loader.x = 17;
loader.y = 180;
addChild(loader);
addEventListener(Event.ENTER_FRAME, function (event:Event) : void{
arguments = null;
if (stage.loaderInfo.bytesTotal != 0){
loader.masker.scaleX = stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal;
if (stage.loaderInfo.bytesLoaded == stage.loaderInfo.bytesTotal){
//removeChild(loader);
nextFrame();
arguments = Class(getDefinitionByName("EverybodyEditsBeta"));
addChild(new arguments());
removeEventListener(Event.ENTER_FRAME, arguments.callee);
}
}
return;
});
return;
}
}
}
ReferenceError: Error #1065: Variable EverybodyEditsBeta is not defined.
at global/flash.utils::getDefinitionByName()
at Function/<anonymous>()[C:\Users\Administrator\Documents\mygame._v55\l oader.as:22]
I have removeChild commented out so I can work on this error and not be stopped by the error it throws, which is still:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Function/<anonymous>()[C:\Users\Administrator\Documents\mygame._v55\l oader.as:20]
Okay, I changed arguments to argument, for simplicity.
and EverybodyEditsBeta.as resides in the fame foled as the .fla and this (loader.as). It is an unnamed package. The only class name in it is EverybodyEditsBeta.
I've research anonymous functions and still don't understand them. Any chance you can
help he get rid of it? Once I see it done I will be able to do it myself.
Sorry I'm patentic.
Here's the latest code:
package{
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class loader extends MovieClip{
public var argument:Class;
public function loader(){
var loader:preloader;
loader = new preloader();
loader.masker.scaleX = 0;
loader.x = 17;
loader.y = 180;
addChild(loader);
addEventListener(Event.ENTER_FRAME, function (event:Event) : void{
argument = null;
if (stage.loaderInfo.bytesTotal != 0){
loader.masker.scaleX = stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal;
if (stage.loaderInfo.bytesLoaded == stage.loaderInfo.bytesTotal){
removeChild(loader);
nextFrame();
argument = Class(getDefinitionByName("EverybodyEditsBeta"));
addChild(new argument());
removeEventListener(Event.ENTER_FRAME, argument.callee);
}
}
return;
});
return;
}
}
}
How do you use loader class? I mean how do you instantiate it?
Also, you cannot use variable with the same name as class - you have variable loader.
Also, how do you import EverybodyEditsBeta class? It must be compiled into current swf before it can be referenced. Is it in separate swf? Why do you have to use getDefinitionByName() but not class directly?
North America
Europe, Middle East and Africa
Asia Pacific