Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.



I am doing one of my first AS3 websites so quite new to all of it. I have added a newPage function to my navigation which should remove thecurrent page using the removeChild function, and then add the new page. It works on the first click but then throws up the error: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller..

my code is as follows:

import fl.transitions.Tween;
import fl.transitions.easing.*;

var currentPage:MovieClip = bio_mc;

var pageBio:bioPage = new bioPage();
var pagePortfolioortfolioPage = new portfolioPage();
var pageContact:contactPage = new contactPage();

bio_mc.targetMC = pageBio;
portfolio_mc.targetMC = pagePortfolio;
contact_mc.targetMC = pageContact;

pageBio.x = pageContact.x = 570;
pageBio.y = pageContact.y = 343.9;
pagePortfolio.x = 452.9;
pagePortfolio.y = 343.9;

addChild(pageBio);

line_mc.x=bio_mc.x;

bio_mc.buttonMode=true;
portfolio_mc.buttonMode=true;
contact_mc.buttonMode=true;


bio_mc.addEventListener(MouseEvent.ROLL_OVER, moveLine);
portfolio_mc.addEventListener(MouseEvent.ROLL_OVER , moveLine);
contact_mc.addEventListener(MouseEvent.ROLL_OVER, moveLine);

bio_mc.addEventListener(MouseEvent.ROLL_OUT, moveLineBack);
portfolio_mc.addEventListener(MouseEvent.ROLL_OUT, moveLineBack);
contact_mc.addEventListener(MouseEvent.ROLL_OUT, moveLineBack);


function moveLine(e:MouseEvent):void
{
new Tween(line_mc, "x", Strong.easeOut, line_mc.x, e.currentTarget.x, 12, false);

}

function moveLineBack(e:MouseEvent):void
{
new Tween(line_mc, "x", Strong.easeOut, e.currentTarget.x, currentPage.x, 12, false);
}

bio_mc.addEventListener(MouseEvent.CLICK, newPage);
portfolio_mc.addEventListener(MouseEvent.CLICK, newPage);
contact_mc.addEventListener(MouseEvent.CLICK, newPage);

function newPage(e:MouseEvent):void
{
removeChild(bio_mc.targetMC);
currentPage = MovieClip(e.currentTarget);
addChild(currentPage.targetMC);
currentPage.targetMC.gotoAndPlay(1);
}


Does anyone know what could be causing this. Any help would be greatly appreciated.

Thanks



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 10-30-2008, 06:30 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
Hi all,

I'm trying to modify a flex utility called photoNavigator. Basically all it does is that it loads a high res jpeg image and allows the user to magnify a portion of the image.

what im trying to do is allow the user to load different images. Obviously i try and remove the previous instance of photoNavgator and add a new instance (which contains the new file location as well). This is the simple code:

********************************************
public function init():void
{
photo1 = new PhotoNavigator('pic1.jpg');
addChild (photo1);
}

public function button9Handler(event:MouseEvent)
{
removeChild(photo1); // removes the previous instance of PhotoNavigator - works
photo2 = new PhotoNavigator('pic2.jpg');
addChild(photo2);//trying to add a new instance of PhotoNavigator - doesnt work
}

*************************
this is the error message i get.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at org.flepstudio:hotoNavigator/setComplete()

please help!!!

ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
Hi All
I am trying to make Video Gallery in AS 3.0. I have placed bunch of containers on my main stage. When user double clicks on any video thumbnail the main videos going to be played on the main stage. XML is loading external videos. The user can also drag the thumbnail and drop(multiple instances of thumbnails) on the main stage to play the main video.
The UILoader component is loading external swfs ( containing external FLVs)on drag and drop on the main stage. Also user would be able to drag and drop the already played videos.
Now my problem is that "When user tries to double clicks on the thumbnial and the video is going to be played on the main stage, when user tries to move that video he will get the run time error 'ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/getChildIndex()
at MethodInfo-1092()'"
To track which video has been selected i used getChildIndex()method.That only happens when user tried to drag the video played by clicked thumbnail not by the dragged thumbnail.
Sorry for the long mail but I have to explain everything to make things clear.
Anybody knows where I am going wrong and how to fix this problem.
Any help will be highly appreciated.
Regards,
Anuj

ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
I have written this code to remove a movieclip called spaceship once it reaches its 40th frame. The code actually works fine and the spaceship is removed but after the spaceship is removed i get this error -

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at SpaceGame_fla::MainTimeline/removeSpaceship()

Does anyone know why?







Attach Code

stage.addEventListener(Event.ENTER_FRAME, removeSpaceship);
function removeSpaceship(evt:Event):void{
if (spaceship.currentFrame == 40)
{
removeChild(spaceship);
}
}

ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
Hi all,

I'm trying to modify a flex utility called photoNavigator. Basically all it does is that it loads a high res jpeg image and allows the user to magnify a portion of the image.

what im trying to do is allow the user to load different images. Obviously i try and remove the previous instance of photoNavgator and add a new instance (which contains the new file location as well). This is the simple code:

********************************************
public function init():void
{
photo1 = new PhotoNavigator('pic1.jpg');
addChild (photo1);
}

public function button9Handler(event:MouseEvent)
{
removeChild(photo1); // removes the previous instance of PhotoNavigator - works
photo2 = new PhotoNavigator('pic2.jpg');
addChild(photo2);//trying to add a new instance of PhotoNavigator - doesnt work
}

*************************
this is the error message i get.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at org.flepstudio:hotoNavigator/setComplete()

please help!!!

ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
I'm having some problems with the removeChild. I read the sticky and the problem lies with the 2 removeChild[s]. But i have no idea how to solve it. T.T Please advice.


Code:
package {
import flash.display.*;
import flash.events.*;
import flash.display.MovieClip;
import flash.utils.Timer;

public class shooting extends MovieClip {

//hot air balloon reactivity
var mouseEase:int = 100;

var floatingBalloon:hotAirBalloon;

//counters for bullets
var counter01:int = 1;
var counter02:int = 1;

var angle:Number = 0;
var radiansToDegrees:Number = 180/Math.PI;
var degreesToRadians:Number = Math.PI/180;

var currentEnemyRotation:Number;

var bulletHolder:MovieClip;
var enemyBody:body;
//var newBullet:bullet;

public function startGame() {
balloon();
enemy();
}

//BAD GUYS HERE
public function enemy(){

//create holder for bullets
bulletHolder = new MovieClip();
addChild(bulletHolder);

//place enemy on stage
enemyBody = new body();
enemyBody.x = 150;
enemyBody.y = 600;
addChild(enemyBody);

function createBullet(startx:Number, starty:Number) {

//place bullets on stage
var newBullet:bullet = new bullet();
addChild(newBullet);
newBullet.x = startx;
newBullet.y = starty;

//bulletHolder.addChild(newBullet);

//create bulletArray and add in newBullet
var bulletArray:Array = new Array();
bulletArray.push(newBullet);

newBullet.currentEnemyRotation = enemyBody.rotation+90;

//add onEnterFrame for movingBullet.
newBullet.addEventListener(Event.ENTER_FRAME, moveBullet);

function moveBullet(event:Event):void {

//tell bullets to move via rotation
newBullet.x+=Math.cos((newBullet.currentEnemyRotation)*degreesToRadians);
newBullet.y+=Math.sin((newBullet.currentEnemyRotation)*degreesToRadians);

newBullet.addEventListener(Event.ENTER_FRAME, hitTest);

}
function hitTest(event:Event){
for(var i:int=bulletArray.length-1;i>=0;i--){
if (newBullet.x > stage.stageWidth || newBullet.x < 0 || newBullet.y > stage.stageHeight || newBullet.y < 0) {
removeChild(newBullet);
} else if (bulletArray[i].hitTestObject(floatingBalloon)) {
removeChild(newBullet);
}
}
}
}

//rotate enemy body
enemyBody.addEventListener(Event.ENTER_FRAME, rotateEnemy);

function rotateEnemy(event:Event):void {

//enemy aim @ 100 pixels away from target
angle = Math.atan2(mouseY+100-enemyBody.y, mouseX+100-enemyBody.x);
angle *= radiansToDegrees;
enemyBody.rotation = angle - 90;

}

//create the shooting of bullets
stage.addEventListener(Event.ENTER_FRAME, shootBullets);

function shootBullets(event:Event) {

//counter for time between creations of bullets
if (counter01 >= 50) {
counter02++;
counter01 = 1;
} else {
counter01++;
}
if (counter02 >= 100) {
createBullet(150+(40*Math.cos((enemyBody.rotation+90)*degreesToRadians)),600+(40*Math.sin((enemyBody.rotation+90)*degreesToRadians)));
counter02 = 1;
} else {
counter02++;
}
}
}

//GOOD GUYS HERE
public function balloon() {

//place balloon on stage
floatingBalloon = new hotAirBalloon();
addChild(floatingBalloon);

//balloon's starting position
floatingBalloon.x = 350;
floatingBalloon.y = 50;

this.addEventListener(Event.ENTER_FRAME, followMouse);

function followMouse(){
//follow and easing of balloon
var endX = root.stage.mouseX;
var endY = root.stage.mouseY;
floatingBalloon.x += (endX-floatingBalloon.x)/mouseEase;
floatingBalloon.y += (endY-floatingBalloon.y)/mouseEase;
}
}
}
}
Eplus

Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller
I don't get this, any help I appreciate! I'm trying to add a back button once I click a main menu button then remove the back button once it is pressed. I get the title error. Thank you.

mainmenu.btn02.addEventListener(MouseEvent.CLICK, onBtn02Click);

function onBtn02Click(evt:MouseEvent):void{
backbtn.x = 314;
backbtn.y = 9;
addChild(backbtn);

}



backbtn.addEventListener(MouseEvent.CLICK, onBtnBackClick);

function onBtnBackClick(evt:MouseEvent):void {
removeChild( backbtn );
}

Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
Hi all,
I was wandering if i could ask for your help again.
I have searched the forum and used the advise given but I still get an error and cant understand why.
I want to removechild(hamster) when it hits the movieclip sea but it throughs up this error.
Many thanks for your help in advance.

Here is my code

ActionScript Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at bubHamGame_fla::MainTimeline/HamsterGo()

ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;


var pirateShip:Pirate = new Pirate();

var sea:Sea = new Sea();

var shipSpeed:Number = 15;
var edge2:Number = 5;
var targetX:Number = pirateShip.x;
var easing:Number = 7;
var keyPressed:uint;
var rightKey:Boolean;
var leftKey:Boolean;
var inTween:Tween;
var alphaTween:Tween;
var hamStartY:Number = 10;
var hamFinishY:Number = 550;
var hamster:MovieClip;
var hamstersInGame:uint;
var hamsterArray:Array = new Array();
var score:int;
var energy:int;




var scoreDisp:TextField = new TextField();
scoreDisp.text = "Score: " + score;
scoreDisp.embedFonts = true;
scoreDisp.width = 100;
scoreDisp.x = 0;
scoreDisp.y = 0;
scoreDisp.selectable = true;
scoreDisp.border = false;
scoreDisp.autoSize = TextFieldAutoSize.LEFT;
var scoreFormat:TextFormat = new TextFormat();
var myFont:Font = new OCRAStd();
scoreFormat.color = 0xFFFFFF;
scoreFormat.size = 15;
scoreFormat.font = myFont.fontName;
scoreDisp.setTextFormat(scoreFormat);
addChild(scoreDisp);


function initGame():void
{
    rightKey = false;
    leftKey = false;

    sea.x = 280;
    sea.y = 540;
    addChild(sea);


    pirateShip.x = canvas.width / 2;
    pirateShip.y = 460;
    addChild(pirateShip);


    var timer:Timer = new Timer(2000);
    timer.addEventListener(TimerEvent.TIMER, hamsterHandler);



    timer.start();

}

function hamsterHandler(event:TimerEvent):void
{
    hamster = new Hamster();
    hamster.x = Math.random() * 550;
    hamster.y = 10;
    inTween = new Tween(hamster,"y",Strong.easeIn,hamStartY,hamFinishY,5,true);


    hamster.addEventListener(Event.ENTER_FRAME, HamsterGo);
    addChild(hamster);

    hamsterArray.push(hamster);
    trace(hamsterArray);
}
function HamsterGo(event:Event):void
{

    for (var i:int = 0; i< hamsterArray.length; i++)
    {
        if (hamsterArray[i].hitTestObject(sea))
        {

            removeChild(hamsterArray[i]);////My problem is here i think.
            hamsterArray.slice(i,1);
            score += 1;
            scoreDisp.text="Score: "+score;
            scoreDisp.setTextFormat(scoreFormat);
        }


    }




}



stage.addEventListener(KeyboardEvent.KEY_DOWN, pressKey);
stage.addEventListener(KeyboardEvent.KEY_UP, releaseKey);
function pressKey(event:KeyboardEvent):void
{
    keyPressed=event.keyCode;
    if (keyPressed==Keyboard.RIGHT)
    {
        rightKey=true;
    }
    if (keyPressed==Keyboard.LEFT)
    {
        leftKey=true;
    }
    pirateShip.addEventListener(Event.ENTER_FRAME,moveDefend);
}
function releaseKey(event:KeyboardEvent):void
{
    var thisKey:uint=event.keyCode;
    if (thisKey==Keyboard.RIGHT)
    {
        rightKey=false;
    }
    if (thisKey==Keyboard.LEFT)
    {
        leftKey=false;
    }
}
function moveDefend(event:Event):void
{
    if (rightKey&&pirateShip.x<canvas.width-edge2)
    {
        pirateShip.x+=shipSpeed;
    }
    if (leftKey&&pirateShip.x>45)
    {
        pirateShip.x-=shipSpeed;
    }

}
initGame();

Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller.
Hello,

I'm having problems with the add and remove child methods inside of flash. Essentially, I have a button which has mouseEvent rollover that will fade out an image, remove it from the display list... addChild to the same movieclip and then fade in the movieclip with the new image.... however... i keep getting this following error? which I'm not sure why it's doing this....


here's the error message...

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at bloedel_map_fla::MainTimeline/clearImage()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at gs::TweenLite/complete()
at gs::TweenLite/render()
at gs::TweenLite$/executeAll()
here's my code...


the final four lines... are the function for adding and removing the display objects


thanks for the help!

import gs.TweenLite;
import fl.motion.easing.*

var loadersArray:Array = new Array;
var ldr:Loader = new Loader();
var loader:URLLoader = new URLLoader();
var gallery:XML;
var currNumber:Number = 0;
var numImgs:Number;
mcHolder1.mask = mcMask;
mcHolder1.cacheAsBitmap = true;
mcMask.cacheAsBitmap = true;

btnMain.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnGlen.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnWaterfall.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnMain.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnJapanese.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnVisitor.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnMoss.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnReflection.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnWoods.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnBird.addEventListener(MouseEvent.ROLL_OVER, moveMc, false,0,true);
btnMain.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnGlen.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);

btnWaterfall.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnMain.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnJapanese.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnVisitor.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnMoss.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnReflection.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnWoods.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);
btnBird.addEventListener(MouseEvent.ROLL_OUT, moveBack, false,0,true);

btnWaterfall.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnMain.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnJapanese.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnVisitor.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnMoss.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnReflection.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnWoods.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);
btnBird.addEventListener(MouseEvent.CLICK, changeImage, false,0,true);



function changeImage(e:MouseEvent){
trace("rolled over big mc");
}
function moveMc (e:MouseEvent){
//trace(e.currentTarget.name);
switch(e.currentTarget.name){
case ("btnMain"):
currNumber=0;
break;
case("btnGlen"):
currNumber=1;
break;
case ("btnWaterfall"):
currNumber=2;
break;
case ("btnVisitor"):
currNumber=3;
break;
case ("btnJapanese"):
currNumber=4;
break;
case ("btnReflection"):
currNumber=5;
break;
case ("btnWoods"):
currNumber=6;
break;
case ("btnBird"):
currNumber=7;
break;
}
trace(currNumber);
TweenLite.to(mcHolder1, .5, { ease:Sine.easeOut, onComplete:clearImage,alpha:0});

}

//e.currentTarget.blendMode = BlendMode.SCREEN;
//TweenLite.to(e.currentTarget, .5, { ease:Sine.easeOut, frame:10, scaleY:1.1, scaleX:1.1});

function moveBack (e:MouseEvent){
//e.currentTarget.blendMode = BlendMode.NORMAL;
TweenLite.to(e.currentTarget, .5, { ease:Sine.easeOut, scaleY:1, scaleX:1});
}

//load xml
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded,false,0,true);
ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0,true);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0,true);
loader.addEventListener(Event.COMPLETE, onComplete, false, 0,true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0,true);
//loader.load(new URLRequest("new-content/common/images/gallery.xml"));
loader.load(new URLRequest("gallery_map.xml"));
function onComplete(evt:Event):void {
try {
gallery = new XML(evt.target.data);
numImgs = (gallery.image.length());

for(var i:int=0;i<numImgs;i++){
loadersArray= new Loader();
loadersArray.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
loadersArray.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loadersArray.load(new URLRequest(gallery.image));
trace("array");
}

firstImage();
loader.removeEventListener(Event.COMPLETE, onComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
} catch (err:Error) {
trace("could not parse loaded content as XML:
" + err.message);
}
}
function onIOError(evt:IOErrorEvent):void {
trace("An error occured when attempting to load the XML.
" + evt.text);
}

function loaded(evt:Event):void{

trace(evt.target.content);
}

function firstImage(){
trace("first image");
mcHolder1.addChild(loadersArray[currNumber]);
}
function clearImage():void{
mcHolder1.removeChild(loadersArray[currNumber-1]);
mcHolder1.addChild(loadersArray[currNumber]);
TweenLite.to(mcHolder1, .5, { ease:Sine.easeOut, alpha:1});
//trace('clearImage function');
}

Error #2025: The Supplied DisplayObject Must Be A Child Of T
I know this problem has been up here before but just that case didn't help me.

This is the source:

Code:

var kampanjFlikLoader:Loader = new Loader();
var kampanjFlikHolder:Sprite = new Sprite();

var kampanjBigLoader:Loader = new Loader();
var kampanjBigHolder:Sprite = new Sprite();
var blommaPreload:BlommaPreload = new BlommaPreload();


kampanjFlikLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onKampanjFlikComplete);

kampanjFlikLoader.load(new URLRequest("kampanj/kampanjSmall.jpg"));

function onKampanjFlikComplete(evt:Event) {
      
      
      addChildAt(kampanjFlikHolder,3);
      
      kampanjFlikHolder.addChild(evt.currentTarget.content);
      
      kampanjFlikHolder.x = 60;
      kampanjFlikHolder.y = stageH -kampanjFlikHolder.height + 1;

      kampanjFlikHolder.addEventListener(MouseEvent.MOUSE_OVER, objectOVER);
      kampanjFlikHolder.addEventListener(MouseEvent.MOUSE_OUT, objectOUT);
      kampanjFlikHolder.addEventListener(MouseEvent.MOUSE_UP, onKampanj);

     }

function onKampanj(e:MouseEvent)
{
   removeLastFromDisplay();
   
   kampanjBigLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onKampanjBigComplete);
//   kampanjBigLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
   kampanjBigLoader.load(new URLRequest("kampanj/kampanjBig.jpg"));

   addDarkShadeFullscreen()
      
   addChild(kampanjBigHolder);
      
   blommaPreload.visible = true;
   blommaPreload.gotoAndPlay(1);
   kampanjBigHolder.addChild(blommaPreload);
   blommaPreload.x = blommaPreload.parent.height/2;
   blommaPreload.y = blommaPreload.parent.width/2;
   
   
   
   function onKampanjBigComplete(evt:Event) {
      
      kampanjBigHolder.removeChild(blommaPreload);
      kampanjBigHolder.addChild(evt.target.content);
      
      kampanjBigHolder.x = stageW/2 - kampanjBigHolder.width/2;
      kampanjBigHolder.y = stageH/2 - kampanjBigHolder.width/2;
      
       
      kampanjBigHolder.buttonMode = true;
      kampanjBigHolder.addEventListener(MouseEvent.MOUSE_UP, onExitKampanj);
         
     }

    function onExitKampanj(e:MouseEvent)
   {

   checkIfDarkShadeFullscreenIsVisible();
   removeChild(kampanjBigHolder);
   
   addChild(ornament);
   ornament.alpha = 0;
   TweenMax.to(ornament, 1.5, {alpha:1});
   
   }
   
}

function addDarkShadeFullscreen():void
{
darkShadeFullscreen.alpha = 0;

darkShadeFullscreen.x = 0;
darkShadeFullscreen.y = 0;
TweenMax.to(darkShadeFullscreen, 0.7, {alpha:0.6});
addChild(darkShadeFullscreen);
}

function checkIfDarkShadeFullscreenIsVisible():void
{
   if (this.stage.contains(darkShadeFullscreen))
   {
      this.removeChild(darkShadeFullscreen);
   }
}



At initial kampanjFlikHolder loads a small external bitmap and makes it clickable.
When i click the kampanjFlikHolder it should load a big bitmap and show it. Works great first time.
second time it shows:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at MethodInfo-257()

Then i click a third time. Works again. And so on.
This is my first atempt to load external bitmaps.
I have built a complete site with imported stuff but some of the bitmaps needs to be external to keep the initial loading short.

Do i have to unload the bitmap each exit?

The Supplied DisplayObject Must Be A Child Of The Caller
Hello,

I have a Flash movie which creates a loader object and within it loads another SWF that I have created.

The SWF I am loading uses a document class to create a photo gallery of images, and this document class uses a supplied XML file url to tell it where the images can be found so it can load up the relevant images into the movie.

All this works fine, until I start using pagination links (e.g. "click here for next page" and "click here for previous page") within my main Flash movie to load other XML files into the external SWF movie (I use different XML files for each page of images). When I click on either of my pagination buttons in my main Flash movie I get the following error message....

Code:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
   at flash.display::DisplayObjectContainer/removeChild()
   at MethodInfo-3()


Now this error (as far as I understand it) is happening because when I click on either of my pagination buttons the init() function (the init function is setup within my main Flash movie and creates the loader object and starts loading the "photo gallery" SWF) is actually being called from the button instances and not from the main timeline (if you see my full code below you'll see that I have the init() function called from the main timeline when the main Flash movie first loads), but the moment I try calling this function from another function I get the above error message.

I've tried using error handling (everywhere) but with no luck?

Any help would be greatly appreciated!!

Kind regards,
M.

The full code for my main Flash movie is as follows:

Code:

var i:int = 1;

prevPage.addEventListener(MouseEvent.CLICK, callPage);
nextPage.addEventListener(MouseEvent.CLICK, callPage);

function callPage(e:MouseEvent):void
{
   switch(e.target.name)
   {
      case "prevPage":
         i--
         if(i < 1){i = 1}; // make sure the counter doesn't go lower than one
         init("Portfolio-DesignForPrint-Page" + i + ".xml");
         break;
         
      case "nextPage":
         i++         
         if(i > 5){i = 5}; // make sure the counter doesn't go higher than five
         init("Portfolio-DesignForPrint-Page" + i + ".xml");
         break;
   }
}

// load page one by default
init("Portfolio-DesignForPrint-Page1.xml");

function init(url)
{
   // Request the content
   var req:URLRequest = new URLRequest("PhotoViewer.swf");
   
   // Create a loader object
   var loader:Loader = new Loader();
   
   // Load the content
   loader.load(req);
   
   // Set loader position
   loader.x = 215;
   loader.y = 36;
   
   // Add loader into the Display List
   addChild(loader);
   
   // Check loading progress
   loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, checkProgress);
   
   // Update progress bar
   function checkProgress(e:ProgressEvent):void
   {
      var percent:int = (e.currentTarget.bytesLoaded / e.currentTarget.bytesTotal) * 100;
      loadingBar.text = String(percent + '%');
      mcLoadingBar.width = percent;
   }
   
   // Check when content is loaded
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
   
   // Remove the progress bar objects
   function contentLoaded(e:Event):void
   {
      // Access method of loaded SWF's document class
      var oloaderInfo:LoaderInfo = e.target as LoaderInfo;
      var swf:Object = oloaderInfo.content;
      swf.init(url); // the init() method of the document class excepts an XML file url to load
      
      removeChild(loadingBar);
      removeChild(mcLoadingBar);
      removeChild(loadingBarBorder);
   }
}

RemoveChildAt() - The Supplied DisplayObject Must Be A Child Of The Caller
Hi everyone,
I have a problem removing a child from the stage with removeChildAt();]
(I will paste just the relevant parts of code)

-I linked an MovieClip Symbol from library, and called it Tela; Then I create the tela as follows:

ActionScript Code:
var tela = new Tela();

-Every time the user clicks a link from a html text, the code calls the function as follows:

ActionScript Code:
function createTela(url:String) {
stage.addChildAt(tela,1);
}

-Then, on the tela object added, are a movie, enabled as button, instance as botaoFundoTela. every time the user clicks that button, the tela movieclipe may be removed from stage:


ActionScript Code:
function createTela(url:String) {
stage.addChildAt(tela,1);

tela.botaoFundoTela.buttonMode=true;
tela.botaoFundoTela.addEventListener(MouseEvent.CLICK, botaoFundoClick);

function botaoFundoClick(e:MouseEvent):void {
        stage.removeChildAt(1);
}
}
It works fine. The child was removed from stage.

But, if, after that, I click another time on the link, the child was removed from stage AND I got this error on the Output Panel:

"The supplied DisplayObject must be a child of the caller."

Any tips about why that appears?

Thanks,

DisplayObject Must Be A Child Of The Caller
Hi all, hope you can assist me with this problem I'm having. I'm basically trying to refresh a jpg image every second from within my flash project. The code so far:


Code:
//This function is called from the loader's event listener.
//It moves the loaded image into the appropriate container for display
function imgLoaded(event:Event):void
{
movie.get_picture.addChild(l.content);
};

//This is the function called by the timer that performs all the above
//loading steps each time the timer ticks. This updates the image once per
//second.
function refresh_url(event:TimerEvent){
var unique = new Date().getTime();
var url:String = "http://www.live-photo.com/asheville-.jpg?" + unique;
var urlReq:URLRequest = new URLRequest(url);
l.load(urlReq);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
};

//Create the timer object that will call the function to update the image
//object once per second.
var myTimer = new Timer(1000);
//Add an event listener to the timer to refresh the image every time the timer
//ticks
myTimer.addEventListener("timer",refresh_url);
//Start the timer
myTimer.start();
The image refreshes, but only on what looks like every 2nd call to the refresh_url function. It will load the image once, then it will throw an error:


Quote:




ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/flash.display:Loader::_load()
at flash.display::Loader/load()
at map_project1_fla::MainTimeline/refresh_url()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()




And then it will load the picture, then it will throw the error, then load, then throw, etc...

What do I need to do to avoid this error? Thanks in advance.

ArgumentError: Error #2025:...HELP
I have searched, searched, and....searched for a solution and just about stayed up all night dealing with this. So this is my last resort.

I have a navigation which has 5 buttons and each loads a different external SWF. There is a simple transition created with the Caurina Tween's that takes place before the current SWF is removed (unloaded) and the next is loaded. However, the past external SWF does not seem to be unloading, and they just stack up everytime the button is pressed. I am also getting this error everytime the script gets to the loader.unload(); action.

Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/unload()
at MethodInfo-164()
It seems that the loader.content just doesn't want to be removed and created as a null. Does anyone one have any ideas? Thanks


Code:

//Content Switch transition

private function startSwitch(thePage) {
Tweener.addTween(loader.content, {_blur_blurX:10,_blur_blurY:10, time:0.9, onComplete:moveAway, transition:"easeOut"});


addEventListener(Event.ENTER_FRAME, launchPage);

//if the content container is empty load new swf when tranisition is finished
function launchPage(e:Event):void {
trace(loader.content);
if (loader.content == null) {
mainContent();
load(new URLRequest(thePage));
removeEventListener(Event.ENTER_FRAME, launchPage);
}
}
}

private function moveAway() {
Tweener.addTween(loader.content, {_blur_blurX:50,_blur_blurY:10, time:0.3});
Tweener.addTween(loader.content, {x:1000, time:0.5, transition:"easeInBack", onComplete:removePrevious});
}
private function removePrevious() {
loader.unload();
}
}

ArgumentError: Error #2025:
Hi,

I am new to writing in action script, I trying to create a gallery. The code appears to be working but I get the following error and I can't figure how to fix it:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/unload()
at galleryAS3_fla::MainTimeline/loadThumbNails()
at galleryAS3_fla::MainTimeline/thumbNailCompleteHandler()

The function loadThumbNails() is call first the error occurs when the load or unload is called, but everything seems to be work as it should, apart from the error message.


Code:
function thumbNailCompleteHandler(event:Event):void {

trace(event);

if (event.type == "complete") {
// add the content of the load to the holder
gThumbArray[gCurrentThumbIndex].holder_mc.thumbImage_mc.addChild(event.target.content);

// start the process to load the next thumb nail
gCurrentThumbIndex++;

if (gCurrentThumbIndex < gCurrentGalNumOfImages) {
loadThumbNails();
//progressBar_mc.setProgress(gCurrentThumbIndex,numberOfImages-1);
}
} else if (event.type == "unload") {
thumbNailLoader.load(gThumbNailURL);
}
}

function largeImageCompleteHandler(event:Event):void {
largeImageHolder_mc.largeImage_mc.addChild(largeImageLoader.content);
}

function loadThumbNails() {

var template:thumbNailTemplate = new thumbNailTemplate();

gThumbArray[gCurrentThumbIndex] = sliderHolder_mc.slider_mc.addChild(template);
gThumbArray[gCurrentThumbIndex].x = gCurrentThumbIndex * gThumbArray[gCurrentThumbIndex].width;
gThumbArray[gCurrentThumbIndex].holder_mc.highlight_mc.visible = false;

gThumbArray[gCurrentThumbIndex].holder_mc.indexNumber = gCurrentThumbIndex;
var imageNumber:Number = gCurrentThumbIndex+1;
gThumbArray[gCurrentThumbIndex].holder_mc.imageName = 'image_'+imageNumber+'.jpg';

gThumbNailURL = new URLRequest("images/"+gCurrentGalDirLocation+"/Thumbs/"+gThumbArray[gCurrentThumbIndex].holder_mc.imageName);

if (gCurrentThumbIndex == 0) {
thumbNailLoader.load(gThumbNailURL);
}else{
thumbNailLoader.unload();
}
//gThumbArray[indexNumber].holder_mc.addEventListener(MouseEvent.CLICK, loadLargeImage);

}

ArgumentError: Error #2025 In AS3
I am getting this error in my code, but when i run the swf file there is nothing wrong, can you please tell me how to fix it?
error:

Quote:




ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at MethodInfo-43()





code:


Quote:




// import the packages
import flash.display.Loader;
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.events.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;


// set variables
var loader:Loader;
var request:URLRequest;

//create new loader object
loader = new Loader();

//create new Loaderbar
var loader_mc:loaderbar_mc = new loaderbar_mc();



// Listener for the home button
home_btn.addEventListener(MouseEvent.CLICK, myClickListener);

/*
In the function below, we declare a variable for the tween, and then address two cases. If the panel is closed (indicated by the direction of the button), we rotate the button, change the button label, and then construct a tween that moves the panel from its starting point to a point 102 px the left. This distance assures that the whole panel has moved to completely within the stage area. If the panel is open, we essentially reverse these actions. See the help files for the fl.motion.easing package for other choices of an easing function.
*/

function myClickListener(event:MouseEvent):void
{



var myTween:Tween;
if (home_btn.scaleY == 1) {

//assign attributes and display
loader_mc.x=350;
loader_mc.y=150;
addChild(loader_mc);

//add Loader object to the display list
addChild(loader);

//create new URL request object
request = new URLRequest("Portfolio.swf");

//load the request object into the Loader object
loader.load(request);

//add listener for loading purposes
loader.contentLoaderInfo.addEventListener(Progress Event.PROGRESS, progressHandler);

//add listener function
function progressHandler(myevent:ProgressEvent):void{
var myprogress:Number = myevent.target.bytesLoaded/myevent.target.bytesTotal;
loader_mc.bar_mc.scaleX = myprogress;
loader_mc.percentage_txt.text = Math.round(myprogress*100) + "% Loaded";
}

//add listener for loading completed
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, alldone);

//add nav to stage and remove loader
function alldone(myEvent:Event):void{
container_mc.addChild(loader);
removeChild(loader_mc);
}

myTween = new Tween(container_mc, "x", Back.easeOut, 1024, 0, 10);
myTween = new Tween(home_btn, "y", Back.easeOut, 480, 700, 10);
home_btn.scaleY = .5;
home_btn.scaleX = .5;
}

else {
myTween = new Tween(container_mc, "x", Back.easeOut, 0, 1024, 10);
myTween = new Tween(home_btn, "y", Back.easeOut, 700, 480, 10);
home_btn.scaleY = 1;
home_btn.scaleX = 1;
}

}

ArgumentError: Error #2025:...
I have searched, searched, and....searched for a solution and just about stayed up all night dealing with this. So this is my last resort.

I have a navigation which has 5 buttons and each loads a different external SWF. There is a simple transition created with the Caurina Tween's that takes place before the current SWF is removed (unloaded) and the next is loaded. However, the past external SWF does not seem to be unloading, and they just stack up everytime the button is pressed. I am also getting this error everytime the script gets to the loader.unload(); action.


ActionScript Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::Loader/unload()
    at MethodInfo-164()


It seems that the loader.content just doesn't want to be removed and created as a null. Does anyone one have any ideas? Thanks


ActionScript Code:
//Content Switch transition

        private function startSwitch(thePage) {
            Tweener.addTween(loader.content, {_blur_blurX:10,_blur_blurY:10, time:0.9, onComplete:moveAway, transition:"easeOut"});


            addEventListener(Event.ENTER_FRAME, launchPage);
           
            //if the content container is empty load new swf when tranisition is finished
            function launchPage(e:Event):void {
                trace(loader.content);
                if (loader.content == null) {
                    mainContent();
                    load(new URLRequest(thePage));
                    removeEventListener(Event.ENTER_FRAME, launchPage);
                }
            }
        }
       
        private function moveAway() {
            Tweener.addTween(loader.content, {_blur_blurX:50,_blur_blurY:10, time:0.3});
            Tweener.addTween(loader.content, {x:1000, time:0.5, transition:"easeInBack", onComplete:removePrevious});
        }
        private function removePrevious() {
            loader.unload();
        }
    }

ArgumentError: Error #2025:
Hello

I get the following error message, this happens when i move between menus items, is there some way of knowing the line no in my application, what is displayed is the lines of code of Action Script, Tried to add a try.. catch.. in the Action script code but it does not get updated.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.text::TextField/set htmlText()
at mx.core::UITextField/set htmlText()[E:dev3.0.xframeworksprojectsframeworksrcmx coreUITextField.as:383]
at mx.controls::TextArea/commitProperties()[E:dev3.0.xframeworksprojectsframeworksrcmx controlsTextArea.as:1888]
at mx.core::UIComponent/validateProperties()[E:dev3.0.xframeworksprojectsframeworksrcmx coreUIComponent.as:5670]
at mx.managers::LayoutManager/validateProperties()[E:dev3.0.xframeworksprojectsframeworksrcmx managersLayoutManager.as:519]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:dev3.0.xframeworksprojectsframeworksrcmx managersLayoutManager.as:669]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[E:dev3.0.xframeworksprojectsframeworksrcmx coreUIComponent.as:8460]
at mx.core::UIComponent/callLaterDispatcher()[E:dev3.0.xframeworksprojectsframeworksrcmx coreUIComponent.as:8403]

TIA

ArgumentError: Error #2025
This is ridiculous, why do I keep getting this error. I can't even find any information on the internet about it... i searched Google for 'flash cs3 error 2025' and it pulls 149 English pages. What does this error mean, how do I fix it and how do i prevent it. Also, I was wondering what are some best practices for using the debug console in Flash.

PS - I am using Adobe Flash CS3 Professional...
the error comes after i enter frame 40. there is nothing in there except a single text input component. I have tried to remove all code, and it still pops up. I deleted all other frames except this one and it fixed it but i don't know why it was there. hmmm, the error message is...








Attach Code

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at fl.managers::FocusManager/fl.managers:FocusManager::getChildIndex()
at fl.managers::FocusManager/fl.managers:FocusManager::sortByDepth()
at fl.managers::FocusManager/fl.managers:FocusManager::sortByTabIndex()
at Array$/Array::_sort()
at Array/http://adobe.com/AS3/2006/builtin::sort()
at fl.managers::FocusManager/fl.managers:FocusManager::sortFocusableObjectsTabIndex()
at fl.managers::FocusManager/fl.managers:FocusManager::sortFocusableObjects()
at fl.managers::FocusManager/fl.managers:FocusManager::keyDownHandler()
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at fl.managers::FocusManager/fl.managers:FocusManager::getChildIndex()
at fl.managers::FocusManager/fl.managers:FocusManager::sortByDepth()
at fl.managers::FocusManager/fl.managers:FocusManager::sortByTabIndex()
at Array$/Array::_sort()
at Array/http://adobe.com/AS3/2006/builtin::sort()
at fl.managers::FocusManager/fl.managers:FocusManager::sortFocusableObjectsTabIndex()
at fl.managers::FocusManager/fl.managers:FocusManager::sortFocusableObjects()
at fl.managers::FocusManager/getNextFocusManagerComponent()
at fl.managers::FocusManager/fl.managers:FocusManager::setFocusToNextObject()
at fl.managers::FocusManager/fl.managers:FocusManager::keyFocusChangeHandler()

TroubleShooting ArgumentError: Error #2025
I recently added code to dynamically build the ViewStack children (calling addChild)

Now I am getting Error #2025

I check the Runtime Error page and all it says is:

"2025The supplied DisplayObject must be a child of the caller."

Error Log:


Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildIndex()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:3876]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_removeChild()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:3810]
at mx.core::ContainerRawChildrenList/removeChild()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainerRawChildrenList.as:157]
at mx.core::Container/styleChanged()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:3005]
at mx.controls::ButtonBar/styleChanged()[E:dev3.0.xframeworksprojectsframeworksrcmxcontrolsButtonBar.as:453]
at mx.controls::ToggleButtonBar/styleChanged()[E:dev3.0.xframeworksprojectsframeworksrcmxcontrolsToggleButtonBar.as:374]
at mx.core::UIComponent/notifyStyleChangeInChildren()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreUIComponent.as:7696]
at mx.core::Container/commitProperties()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:2624]
at mx.core::UIComponent/validateProperties()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreUIComponent.as:5670]
at mx.managers::LayoutManager/validateProperties()[E:dev3.0.xframeworksprojectsframeworksrcmxmanagersLayoutManager.as:519]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:dev3.0.xframeworksprojectsframeworksrcmxmanagersLayoutManager.as:669]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreUIComponent.as:8460]
at mx.core::UIComponent/callLaterDispatcher()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreUIComponent.as:8403]

ArgumentError: Error #2025, Accessing Root
Well... yet another thing I've found with AS3 that makes it a pain in the butt. APPARENTLY you can't access root from within a class that is in a child of root.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display :: DisplayObjectContainer/removeChild()
at thumbnail/ :: removeLargeImage()
at thumbnail/ :: onClickLargeView()

I cannot program this without removing the child of a parent object, something that the Flash compiler apparently prevents you from doing. My code is a simple root.removeChild(...);, but it throws that error every time. How would I get around this limitation to remove a movie clip from root? I've tried this.root.removeChild, but it failed the same way. (I didn't expect it to work, but I gave it a try.)

I'd love help on this, I'm making a website for my dad's friend. Thanks!

(Edited to get rid of the smilies in the argument error.)

Image Gallery - ArgumentError: Error #2025
Hi Guys,

I am new to flash cs3 and action script 3.0. I have made 3 image galleries, that all work fine by themselves, however i have recently tried to link them to a central flash file and I am getting the error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at home_fla::MainTimeline/gotoHome()

I have attached the code for the central/home flash file below.

Basically, all I am trying to achieve is to add the client_images.swf as a child when the client images button is clicked and then listen for a mouse click on the client_images home button and remove the child. This works if I click the home button straight away. If i don't click the home button with in 3 seconds, i get the error.

I have had a good look for a solution to this problem and haven't had much luck. Any help would be greatly appreciated. I can send the .fla's if you need more information.

Cheers,
Paul.









Attach Code

var clientsRequest:URLRequest = new URLRequest("client_images.swf");
var clientsLoader:Loader = new Loader();

btn_clients.addEventListener(MouseEvent.CLICK, clientsClick);

function clientsClick(evt:MouseEvent):void {
//stage.frameRate = 12;
clientsLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, clientsComplete);
clientsLoader.load(clientsRequest);
addChild(clientsLoader);
}

function clientsComplete(evt:Event):void{
evt.target.content.btn_home.addEventListener(MouseEvent.CLICK, gotoHome);
}

function gotoHome(evt:MouseEvent):void {
removeChild(clientsLoader);
}

























Edited: 10/14/2007 at 10:47:17 PM by paulmason411

Removing Child From Stage Error #2025
I'm making the transition from AS2 to AS3 and I thought I had began to start thinking in the new way but now I'm stuck again.

I have a click event listener activated by clicking a movieclip. Everything works well, external swfs are loading, alpha changes working on the other movieclip buttons but as soon as I add a script to remove a child(movieclips from the other movieclip buttons) it gives me this error:
[color="black"][color="black"]
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at mainmovie_fla::MainTimeline/Missionbtn()
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at mainmovie_fla::MainTimeline/collectionClick()

Here is my script, the 2 buttons in question are Collection button and Mission Button


ActionScript Code:
var i=new Loader();
addChild(i);

i.load(new URLRequest("flashslideshow.swf"));
i.x=15
i.y=170

var imageRequest:URLRequest = new URLRequest("about.swf");
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);

var collectionRequest:URLRequest = new URLRequest("collection.swf");
var collectionLoader:Loader = new Loader();
collectionLoader.load(collectionRequest)


//LINKS
var blogLink:URLRequest = new URLRequest("http://www.adobe.com");
var storeLink:URLRequest = new URLRequest("http://www.ehecalt.bigcartel.com");
//

//BLOG BUTTON ************************************

blog_mc.addEventListener(MouseEvent.CLICK, Blogbtn);


function Blogbtn(event:MouseEvent):void
{
    navigateToURL(blogLink);
    mission_mc.alpha = .4;
    store_mc.alpha = .4;
    contact_mc.alpha = .4;
    blog_mc.alpha = 1;
    collection_mc.alpha = .4;
}

//

//STORE BUTTON ********************************

store_mc.addEventListener(MouseEvent.CLICK, Storebtn);
store_mc.addEventListener(MouseEvent.ROLL_OVER, StoreOver);
store_mc.addEventListener(MouseEvent.ROLL_OUT, StoreOut);

function StoreOver(event:MouseEvent):void
{
    store_mc.gotoAndPlay(2);
}

function StoreOut(event:MouseEvent):void
{
    store_mc.gotoAndPlay(5);
}


function Storebtn(event:MouseEvent):void
{
    navigateToURL(storeLink);
    mission_mc.alpha = .4;
    store_mc.alpha = 1;
    contact_mc.alpha = .4;
    blog_mc.alpha =.4;
    collection_mc.alpha = .4;

}

//

// COLLECTION BUTTON

collection_mc.addEventListener(MouseEvent.CLICK, collectionClick);


function collectionClick(event:MouseEvent):void
{
   
    mission_mc.alpha = .4;
    store_mc.alpha = .4;
    contact_mc.alpha = .4;
    blog_mc.alpha =.4;
    collection_mc.alpha = 1;
    addChild(collectionLoader);
    collectionLoader.x = 15;
    collectionLoader.y = 170;
   
    removeChild(i);
   
    }



//

//Contact BUTTON ************************************

contact_mc.addEventListener(MouseEvent.CLICK, Contactbtn);


function Contactbtn(event:MouseEvent):void
{
    mission_mc.alpha = .4;
    store_mc.alpha = .4;
    contact_mc.alpha = 1;
    blog_mc.alpha = .4;
    collection_mc.alpha = .4;
}

//

//MISSION BUTTON
mission_mc.addEventListener(MouseEvent.CLICK,Missionbtn);


function Missionbtn(event:MouseEvent):void

    mission_mc.alpha = 1;
    store_mc.alpha = .4;
    contact_mc.alpha = .4;
    blog_mc.alpha = .4;
    collection_mc.alpha = .4;
    addChild(imageLoader);
    imageLoader.x = 15;
    imageLoader.y = 170;
   
    removeChild(i);
}


//buttonmode
contact_mc.buttonMode = true;
blog_mc.buttonMode = true;
store_mc.buttonMode = true;
collection_mc.buttonMode = true;

Removing Child From Stage Error #2025
I'm making the transition from AS2 to AS3 and I thought I had began to start thinking in the new way but now I'm stuck again.

I have a click event listener activated by clicking a movieclip. Everything works well, external swfs are loading, alpha changes working on the other movieclip buttons but as soon as I add a script to remove a child(movieclips from the other movieclip buttons) it gives me this error:
[color="black"][color="black"]
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at mainmovie_fla::MainTimeline/Missionbtn()
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at mainmovie_fla::MainTimeline/collectionClick()

Here is my script, the 2 buttons in question are Collection button and Mission Button


ActionScript Code:
var i=new Loader();
addChild(i);

i.load(new URLRequest("flashslideshow.swf"));
i.x=15
i.y=170

var imageRequest:URLRequest = new URLRequest("about.swf");
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);

var collectionRequest:URLRequest = new URLRequest("collection.swf");
var collectionLoader:Loader = new Loader();
collectionLoader.load(collectionRequest)


//LINKS
var blogLink:URLRequest = new URLRequest("http://www.adobe.com");
var storeLink:URLRequest = new URLRequest("http://www.ehecalt.bigcartel.com");
//

//BLOG BUTTON ************************************

blog_mc.addEventListener(MouseEvent.CLICK, Blogbtn);


function Blogbtn(event:MouseEvent):void
{
    navigateToURL(blogLink);
    mission_mc.alpha = .4;
    store_mc.alpha = .4;
    contact_mc.alpha = .4;
    blog_mc.alpha = 1;
    collection_mc.alpha = .4;
}

//

//STORE BUTTON ********************************

store_mc.addEventListener(MouseEvent.CLICK, Storebtn);
store_mc.addEventListener(MouseEvent.ROLL_OVER, StoreOver);
store_mc.addEventListener(MouseEvent.ROLL_OUT, StoreOut);

function StoreOver(event:MouseEvent):void
{
    store_mc.gotoAndPlay(2);
}

function StoreOut(event:MouseEvent):void
{
    store_mc.gotoAndPlay(5);
}


function Storebtn(event:MouseEvent):void
{
    navigateToURL(storeLink);
    mission_mc.alpha = .4;
    store_mc.alpha = 1;
    contact_mc.alpha = .4;
    blog_mc.alpha =.4;
    collection_mc.alpha = .4;

}

//

// COLLECTION BUTTON

collection_mc.addEventListener(MouseEvent.CLICK, collectionClick);


function collectionClick(event:MouseEvent):void
{
   
    mission_mc.alpha = .4;
    store_mc.alpha = .4;
    contact_mc.alpha = .4;
    blog_mc.alpha =.4;
    collection_mc.alpha = 1;
    addChild(collectionLoader);
    collectionLoader.x = 15;
    collectionLoader.y = 170;
   
    removeChild(i);
   
    }



//

//Contact BUTTON ************************************

contact_mc.addEventListener(MouseEvent.CLICK, Contactbtn);


function Contactbtn(event:MouseEvent):void
{
    mission_mc.alpha = .4;
    store_mc.alpha = .4;
    contact_mc.alpha = 1;
    blog_mc.alpha = .4;
    collection_mc.alpha = .4;
}

//

//MISSION BUTTON
mission_mc.addEventListener(MouseEvent.CLICK,Missionbtn);


function Missionbtn(event:MouseEvent):void

    mission_mc.alpha = 1;
    store_mc.alpha = .4;
    contact_mc.alpha = .4;
    blog_mc.alpha = .4;
    collection_mc.alpha = .4;
    addChild(imageLoader);
    imageLoader.x = 15;
    imageLoader.y = 170;
   
    removeChild(i);
}


//buttonmode
contact_mc.buttonMode = true;
blog_mc.buttonMode = true;
store_mc.buttonMode = true;
collection_mc.buttonMode = true;

If someone could help me get to the bottom of this and help me understand where I went wrong I'd be extremely grateful.

Socket Connections And "child Of The Caller" Error
So I have 2 problems. One is with an XMLSocket connections. When I have it running in flash it obviously works, but when it's running throught the swf or on a website I get a security error. Is there a way I can make it work either way? Here are the two errors.

When running the swf
SecurityError: Error #2010: Local-with-filesystem SWF files are not permitted to use sockets.

and when running on a website
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://wayfaererstudios.com/Breakout.swf cannot load data from localhost:31337.


Now for this other problem. Here's the error
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Breakout/::blockCollision()
at Breakout/::onEnterFrame()

Just to make it more obvious this is for a breakout game. I get that error when the ball gets close to or hits some of the blocks (not all). It seems to come up when it's possibly hitting multiple blocks. What's kinda weird is that the game still works perfectly fine. It's just annoying to see this error. What I'm mostly doing in that function is checking for the collision detection with some if statements. Here's the code that actually does the work when the statements are true:

removeChild(block);
blocksHit++;
directionY *= -1;

So the problem is obviously the removeChild. The block is just the variable that's stored in an array called blocks and I'm using a for each to go through each of the blocks. How can I get rid of this error?

Child Of The Caller?
Hi,

Im going to try and keep this short! This is the script I have on the first frame...


ActionScript Code:
stop();

var mouseIcon:mouseMC = new mouseMC();
var hidden:hiddenButton = new hiddenButton();

addChild(mouseIcon);
mouseIcon.x=-7.0;
mouseIcon.y=-5.7;

addChild(hidden);
hidden.x=-10.0;
hidden.y=-10.0;

hidden.addEventListener(MouseEvent.CLICK,hidden1);
function hidden1(Event:MouseEvent):void {
    play();
    removeChild(mouseIcon);
    removeChild(hidden);
}

which works fine until i get a little further into the movie, where I have...


ActionScript Code:
stop();

addChild(mouseIcon);
mouseIcon.x=-7.0;
mouseIcon.y=-5.7;

addChild(hidden);
hidden.x=-10.0;
hidden.y=-10.0;

hidden.addEventListener(MouseEvent.CLICK,hiddenB2);
function hiddenB2(Event:MouseEvent):void {
             play();   
             removeChild(mouseIcon);
    removeChild(hidden);
}

It does actually work. But I get the error...


Quote:




ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:: DisplayObjectContainer/removeChild()
at SiteSetUp_fla::MainTimeline/hiddenB2()




...and I can't figure it out. Probably just me but I had a little break from AS for a while. But what am I doing wrong?

Cheers

Child Of The Caller?
Hello everyone. Curious if someone might be able to give me a hand. I am attaching a screen grab for you to see what I am talking about. It has the error there to read.

So what is happening is I have buttons dynamically calling movie clips as drop menus. Now in one of the movie clips there is a sub menu. Now when I roll over the sub menu I get the error that is in the screen grab. I know what the problem is, I just don't know how to fix it. The problem is on the sub menu where I have 4 buttons. When I go to rollover the buttons that is when I get the error. When I remove the buttons then everything is fine.

I hope someone can help.
Thanks in advance.
Kevin

Link to attachment

AS3 : CS4 : RemoveChild(), Not Child Of Caller
Morning All,

Been a while since ive been on, but ive returned to see what CS4 is all about.
I was going to put this in the Newbie Section but thought id keep it here in the AS3.
so apologies if its obvious, but its doing my head it

ok, scenario.

I have a document class
Functions to create and remove the players MC from Screen.
upon start, the createPlayer is called, and successfully adds a player to the screen, all runtime movement works fine ( ie keypress/enterframe listeners fire ok)

the problem arises when i attempt to remove the player movieclip from the stage. i get the error that Display object must be a child of the caller.

ive tried various ideas,
ive tried to create a public Variable that holds the object in the Doc Class and reference that, in case i have a scope issue.
tried to pass in variables in and out of functions.
tried to remove everything else, and using removeChildAt(), no joy

and to top it off, when i try to debug, im looking at the current vars window, and i just cant figure out how to check what level its been created on.

CreatePlayer
// ************************************************** ***************
// FN_CreatePlayer - Function to Create a player
// ************************************************** ***************
function FN_CreatePlayer():void
{
player_mc = new mcPlayer();
stage.addChild(player_mc);
player_mc.x = 60; // default start position for player when created
player_mc.y = 250; // default start position for player when created
trace("Player Created = " + player_mc + " : " + player_mc.name);
}

ok ive also got one that removes the player also
(ive just put the removeChild in here, so i can try to resolve the problem)
// ************************************************** ***************
// FN_EndGame - End the game functions
// After the PLAY GAME button is pressed
// ************************************************** ***************
function FN_EndGame()
{
// delete the player
//FN_DeletePlayer();
//think i might know what the prob is, get rid of the Listeners;
// delete all the baddies
FN_RemoveAllBaddies();
stage.removeChild(MovieClip(player_mc));
//show the title Menu

// show the high score table

}



im not sure if its the display list that im not getting the hang off, or if i have a scoping issue, or im just daft lol
but ive been at it for hours, and to be honest, i cant see the woods for the trees at the moment

ive included all my files, if you want a look at it.
theres alot of junk in there, but im just learning so, youll have to excuse the mess please

Many Thanx in advance.

Cheers
DaZ

[as3] DisplayObject Removing Child From List
I have a MovieClip I've added to a DisplayObject via myParent.addChild( foo ), but the child is not disappearing when I call myParent.removeChild( foo ).

How do you recommend I debug this to detemine why the child is removed?
And how do I enumerate all the children off of an existing DisplayObject?

ArgumentError: Error #2004
***** Edit *****

I figured out what was wrong, when creating the new Rectangle you have to start the x, and y from 0, 0, their not relative to what it's scaling.

Like if the movie clip's x and y are 10 and 10, the scale0Grid should start at 1, 1, not 11, 11

ArgumentError:Error #2012?
I have written an actionscript 3.0 application that uses a custom package I wrote. When I try to run the .swf file and have a try catch block on the point of declaring my custom class object, I get outputted a ArgumentError:Error #2012. I searched for this and it seems the errors is The class cannot be instantiated. This error only happens when I am running my .swf though the Flash Player 9 on Solaris 10 using Mozilla Firefox and not on Windows using IE . Does anyone know how to fix this? The .fla file does know where my custom .as file is, so it doesn't seem to be a problem with it finding the file. Thanks

Error #2025
As the header says, I get this error every other time I click on a thumbnail in my image gallery


ActionScript Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

The case is, that I've got this sprite, that I load all my big images in to, when I click the thumbnails. But first they load, and then they gets smooth


ActionScript Code:
var bigImage:Bitmap = Bitmap(img);
            bigImage.smoothing = true;

and then I add them to index 0 in a sprit if nothing else is in the sprite. If there is a nother image at index 0, I remove it, and add the new one.

But Why do I get this error...?

Error 2025?
Delete this... Sorry, Thanks!

Error #2025?
So, i'm loading a swf into my main movie when an area in the main movie is clicked. It loads perfectly, and the close button works fine. The problem is that after it's closed, if i try clicking to open it again, i get this error...


Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/flash.display:Loader::_load()
at flash.display::Loader/load()
at ActiveInteractive_fla::MainTimeline/golfLoad()
Here's my code...


Code:
//IMPORTS:::::::::::::::::::::
import caurina.transitions.*;
import flash.events.*;
import flash.display.MovieClip;


//LOADER FOR CONTENT:::::::::::::::
var myLoader:Loader = new Loader();


//GOLF BUTTON:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
golf_btn.addEventListener(MouseEvent.MOUSE_OVER, golfOver);
function golfOver(evt:MouseEvent):void {
Tweener.addTween(golf_highlight, {//scaleY:1,
alpha:.60,
time:.5,
delay:0,
transition:"easeOutSine"});
}

golf_btn.addEventListener(MouseEvent.CLICK, golfLoad);
function golfLoad(event: MouseEvent) {
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
myLoader.load(new URLRequest("golf_co.swf"));
stage.addChild(myLoader);
}


golf_btn.addEventListener(MouseEvent.MOUSE_OUT, golfOut);
function golfOut(evt:MouseEvent):void {
Tweener.addTween(golf_highlight, {//scaleY:1,
alpha:0,
time:.5,
delay:0,
transition:"easeOutSine"});
}


//FUNCTION FOR CLOSE BUTTON IN INDIVIDUAL LOADED SWF:::::::::::::::::::::::::::::::
var swf:MovieClip;

function onComplete(e:Event):void {
swf = e.target.content;
//trace("loaded movie is " + swf);
//trace("button instance in loaded movie is " + swf.close_btn);
addChild(swf);

var button:SimpleButton = swf.callout.close_btn;
button.addEventListener(MouseEvent.CLICK, closeSWF);
}

function closeSWF(e:Event):void {
Tweener.addTween(swf.callout,
{scaleX:0, scaleY:0, alpha:0, time:.5, transition:"easeOutSine"});
removeChild(swf);
}
Probably a simple fix, but i'm frizzity fried and can't seem to locate it! Thanks for the extra set of eye balls!

Error 2025?
Hi. Could someone explaine what the error 2025 means?

"
#2025: The supplied DisplayObject must be a child of the caller.

"

I Try to remove a MovieClip but get this error.

Thanks

ArgumentError: Error #1063, I Have The Right Arguments...
Yay, another runtime error! What fun. No line numbers to help out!

Error 1063 says that I have passed 0 arguments even though something wanted four. Even though I commented out most of my code it still doesn't work. (It worked before with all this commented out!)

My timeline actionscript:

Code:
import fl.events.ComponentEvent;

var serverIP = "76.25.252.117";
var serverport:Number = 9000;

var socket:Socket = new Socket();

username.appendText(String(Math.floor(Math.random()*1000)));

Security.allowDomain("76.25.252.117:9000");

var tokens:Array = new Array();

function onConnect(e:Event)
{
if(socket.connected == true)
{
outpug.appendText("Connected!
");
}
else
{
outpug.appendText("U fail!!
");
}
}
function onRecieve(e:Event)
{
var str:String = socket.readUTFBytes(socket.bytesAvailable);
if(str.charAt(0) == 'm')
{
outpug.appendText(str.substr(1));
}
if(str.charAt(0) == 'p')
{
//handleMovement(str);
}
if(str.charAt(0) == "j")
{
//str = str.substr(1);
//var parsed:Array = new Array();
//parsed = parse(str);
//var tok = new token(parsed[0], parsed[1], parsed[2], chars);
//tokens.push( tok );
}
if(str.charAt(0) == "r")
{
//socket.writeUTFBytes( ("j"+username.text + "|"+player.x+"|"+player.y) );
//socket.flush();
}
}

socket.addEventListener(Event.CONNECT, onConnect);
socket.addEventListener(ProgressEvent.SOCKET_DATA, onRecieve);

try
{
socket.connect(serverIP, serverport);
}
catch(e:Error)
{
outpug.appendText(e.toString()+"
");
}

var goingup = 1;
var num = 5000;

function sendMessage(e:Event)
{
if(username.text.length > 3 && messages.text.length > 0)
{
socket.writeUTFBytes("m"+username.text + ": " + messages.text + "
");
socket.flush();
messages.text = "";
}
}
messages.addEventListener(ComponentEvent.ENTER, sendMessage);

function handleMovement(str:String)
{

}

function parse(str:String):Array
{
var array:Array = new Array();
var temp:String = "";
for(var i = 0; i < str.length; i++)
{
if(str.charAt(i) != '|')
{
temp += str.charAt(i);
}
else
{
array.push(temp);
temp = "";
}
}
array.push(temp);
return array;
}
//trace(parse("Hello|mynameis|Davis Goodin the|wonderful"));
And here's my class that I made for a token: This is where I assume the problem is stemming from, but I have no clue how. (The constructor has four arguments. :P)


Code:
package
{

import flash.display.MovieClip;

public class token extends MovieClip
{
public var render:MovieClip;
public var myname:String;

function token(myn, xpos, ypos, renderto)
{
myname = myn;
x = xpos;
y = ypos;
render = renderto;
}
}

}
Any help? I am just trying to test a system for a chat thing, just ask if you need any more info. The code worked until I added the token class, and other than that I only commented out a bunch of stuff!

Error #2025 Issue
I keep getting the #2025 error when i try to remove an object form an array. I always put objects of the same kind in a array to more easily refer to them, but when i call the removeChild(); method it keeps giving an error saying that the supplied displayObject must be a child of the caller.
I call the removeChild(); method in a ENTER_FRAME event assigned to the stage, so can anyone please help me on this issue?

The Error:

Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at zd_fla::MainTimeline/Move()
The part of the script giving the error:

ActionScript Code:
stage.addEventListener (Event.ENTER_FRAME, Move);
function Move (e:Event) {
for (var i:int = 0; i < bullet.length; i++) {
if (bullet[i].hitTestObject(target)) {
removeChild(bullet[i])
}
 }
}

ArgumentError: Error #2012: Class Cannot Be Instantiated.
My SWF compiles fine but I'm getting the 2012 error when I try to instantiate my class and I have no idea how to fix it, help please

Edit: I just commented out every line of code so it's just a basic class that does absolutly nothing and it still throws this error at me

Edit Again.. Resolved, Had to add my classpath to publish settings as well as in preferences - whats up with that? bug? I use a custom classpath on my secondary HDD(never ever gets formatted)

ArgumentError: Error #2068: Invalid Sound
i went back and way simplified...

in hopes that it would work... but voila, it doesnt..

so... heres my code.

i made it so you press play to start... but still it doenst work. i get a new error. even tho it traces the url... it cant play it for some reason


Code:
var xmlLoader:URLLoader = new URLLoader();
var playlistURL:URLRequest = new URLRequest('playlist.xml');
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(playlistURL);
var songsXML:XML = new XML();
songsXML.ignoreWhitespace = true;
var song:Sound = new Sound();

song.addEventListener(Event.COMPLETE, songLoaded);
song.addEventListener(ProgressEvent.PROGRESS, progressHandler);
song.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
btnPlay.addEventListener(MouseEvent.MOUSE_UP, buttonPlay);

function buttonPlay(evt:Event):void{
txtArtistName.text = songsXML.song[0].artist;
txtSongName.text = songsXML.song[0].songname;
var songURL:String = String(songsXML.song[0].file);
trace(songURL);
var songRequest :URLRequest = new URLRequest(songURL);
var scChannel:SoundChannel = new SoundChannel();
scChannel = song.play();
song.load(songRequest);

}

function xmlLoaded(evt:Event):void{
songsXML = XML(xmlLoader.data);
//trace(songsXML.song[0].file);

}

function songLoaded(evt:Event):void {
//songURL = songsXML.song[0].file;

}

function progressHandler(evt:Event):void{
trace(song.bytesLoaded + ' : ' + song.bytesTotal);
}

function ioErrorHandler(evt:IOErrorEvent):void{
trace('error: ' + evt.text);
}
please help me. or direct me to an AS3 tutorial for a mp3 player with an XML playlist...

ArgumentError: Error #2068: Invalid Sound.
Hi all,

I recently made an MP3 player by following a tutorial online, it works great offline but it is giving me alot of trouble online. First it was throwing an IO error which I fixed now it is throwing Error #2068. I suspect it has something to do with file size because each MP3 has at least 20 minutes duration.

Here is the document class.

Code:

package {
   import flash.events.*;
   import fl.events.ListEvent;
   import flash.media.Sound;
   import flash.media.SoundChannel;
   import flash.media.SoundTransform;
   import flash.display.MovieClip;
   import flash.net.URLLoader;
   import flash.net.URLRequest;
      
   

   
   public class Mp3Main extends MovieClip{
      public var url:URLRequest;
      public var xmlLoad:URLLoader;
      public var musicXML:XML;
      public var song:Sound;
      public var channel:SoundChannel;
      public var sndTrans:SoundTransform;
      public var position:Number;
      
      /*The constructor mainly sets up the event listeners, but it also
      starts loading the XML playlist file.*/
      public function Mp3Main() {
         position = 0;
         sndTrans = new SoundTransform(vol_mc.percent);
         url = new URLRequest("/lectures/lecture.xml");
         xmlLoad = new URLLoader(url);
         xmlLoad.addEventListener(Event.COMPLETE, xmlComplete);
         
         playList.addEventListener(ListEvent.ITEM_CLICK, SnglClick, false, 0, true);
         vol_mc.addEventListener("volume_change", updateVolume, false, 0, true);
         seek_mc.addEventListener("seek_change", changeSeekBar, false, 0, true);
         
      /*****************Button Event Listeners************************/
         playPause_mc.addEventListener(MouseEvent.MOUSE_OVER, PlayOver);
         playPause_mc.addEventListener(MouseEvent.MOUSE_OUT, PlayOut);
         playPause_mc.addEventListener(MouseEvent.MOUSE_DOWN, PlayDown);
         playPause_mc.addEventListener(MouseEvent.MOUSE_UP, PlayUp);
         
         stop_mc.addEventListener(MouseEvent.MOUSE_OVER, StopOver);
         stop_mc.addEventListener(MouseEvent.MOUSE_OUT, StopOut);
         stop_mc.addEventListener(MouseEvent.MOUSE_DOWN, StopDown);
         stop_mc.addEventListener(MouseEvent.MOUSE_UP, StopUp);
         
         mute_mc.addEventListener(MouseEvent.MOUSE_OVER, MuteOver);
         mute_mc.addEventListener(MouseEvent.MOUSE_OUT, MuteOut);
         mute_mc.addEventListener(MouseEvent.MOUSE_DOWN, MuteDown);
         mute_mc.addEventListener(MouseEvent.MOUSE_UP, MuteUp);
         
         back_mc.addEventListener(MouseEvent.MOUSE_OVER, BackOver);
         back_mc.addEventListener(MouseEvent.MOUSE_OUT, BackOut);
         back_mc.addEventListener(MouseEvent.MOUSE_DOWN, BackDown);
         back_mc.addEventListener(MouseEvent.MOUSE_UP, BackUp);
         
         forward_mc.addEventListener(MouseEvent.MOUSE_OVER, ForwardOver);
         forward_mc.addEventListener(MouseEvent.MOUSE_OUT, ForwardOut);
         forward_mc.addEventListener(MouseEvent.MOUSE_DOWN, ForwardDown);
         forward_mc.addEventListener(MouseEvent.MOUSE_UP, ForwardUp);
      }
      
      /*This function is used to display the minutes and seconds of the current song.
      It is only used in the updateSeek() function.*/
      public function formatTime(time:Number):String {
         var min:String = Math.floor(time/60000).toString();
         var sec:String = (Math.floor((time/1000)%60) < 10)? "0" + Math.floor((time/1000)%60).toString() : Math.floor((time/1000)%60).toString();
         return(min+":"+sec);
      }
      
   /***********************Event Handlers****************************/
      /*I want to start loading the first song right after filling the
      List component.  If you want it to play automaticly, here is where
      you do that.*/
      private function xmlComplete(event:Event):void {
         var item:Object;
         musicXML = new XML(event.currentTarget.data);
      
         for each(var prop:XML in musicXML.song){
            item = new Object();
            item.label = prop.@disp;
            item.data = prop.@id;
            playList.addItem(item);
         }
         song = new Sound();
         song.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
         song.load(new URLRequest(playList.getItemAt(0).data));
         this.addEventListener(Event.ENTER_FRAME, updateSeek, false, 0, true);
         playList.selectedIndex = 0;
      }
      
      /*When you choose a new item on the List it will play for you.*/
      private function SnglClick(event:ListEvent):void {
         var item:Object = event.item;
         
         try
         {song.close();}
         catch(error)
         {}
         try
         {channel.stop();}
         catch(error)
         {}
         
         song = new Sound();
         song.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
         song.load(new URLRequest(item.data));
         channel = song.play();
         channel.soundTransform = (mute_mc.isMute)? new SoundTransform(0) : sndTrans;
         channel.addEventListener(Event.SOUND_COMPLETE, soundComplete, false, 0, true);
         position = 0;
         playPause_mc.playing = true;
         playPause_mc.gotoAndStop('pause');
      }
      
      /*When a song ends, this will take you to the next song.*/
      private function soundComplete(event:Event):void {
         if(playList.length > playList.selectedIndex + 1){
            playList.selectedIndex++;
            playList.scrollToSelected();
         } else {
            playList.selectedIndex = 0;
            playList.scrollToSelected();
         }
         playList.dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, 0, playList.selectedIndex, playList.selectedIndex, playList.selectedItem));
      }
      
      /*The next two are called handling custom events from within SeekControl.as
      and VolControl.as*/
      private function updateVolume(event:Event):void {
         sndTrans.volume = vol_mc.percent;
         channel.soundTransform = (mute_mc.isMute)? new SoundTransform(0) : sndTrans;
      }
      private function changeSeekBar(event:Event):void {
         position = (song.length/(song.bytesLoaded/song.bytesTotal)) * seek_mc.percent;
         if(playPause_mc.playing){
            channel.stop();
            channel = song.play(position);
            channel.soundTransform = (mute_mc.isMute)? new SoundTransform(0) : sndTrans;
            channel.addEventListener(Event.SOUND_COMPLETE, soundComplete, false, 0, true);
         }
      }
      private function updateSeek(event:Event):void {
         if(channel != null && playPause_mc.playing) {
            var perc:Number = channel.position / (song.length/(song.bytesLoaded/song.bytesTotal));
            seek_mc.moveSeekPos(perc);
            display_mc.timeDisp.text = formatTime(channel.position) + "/" + formatTime((song.length/(song.bytesLoaded/song.bytesTotal)));
            display_mc.timeDisp.text = formatTime(position) + "/" + formatTime((song.length/(song.bytesLoaded/song.bytesTotal)));
         }else {
            
         }
      }
      
      private function ioErrorHandler(event:Event):void {
         trace("ioErrorHandler: " + event);
      }
      
   /*******************PlayPause Handlers*************************/
      private function PlayOver(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.playing) {
            obj.gotoAndStop('pause_over');
         } else {
            obj.gotoAndStop('play_over');
         }
      }
      private function PlayOut(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.playing) {
            obj.gotoAndStop('pause');
         } else {
            obj.gotoAndStop('play');
         }
      }
      private function PlayDown(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.playing) {
            obj.gotoAndStop('pause_down');
         } else {
            obj.gotoAndStop('play_down');
         }
      }
      /*Needs to switch between a pause and play button.*/
      private function PlayUp(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.playing) {
            obj.gotoAndStop('play_over');
            position = channel.position;
            channel.stop();
            obj.playing = false;
         } else {
            obj.gotoAndStop('pause_over');
            channel = song.play(position);
            channel.soundTransform = (mute_mc.isMute)? new SoundTransform(0) : sndTrans;
            channel.addEventListener(Event.SOUND_COMPLETE, soundComplete, false, 0, true);
            obj.playing = true;
         }
      }
      
   /********************Stop Handlers************************/
      private function StopOver(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('stop_over');
      }
      private function StopOut(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('stop');
      }
      private function StopDown(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('stop_down');
      }
      /*Needs to change the Play button as well.*/
      private function StopUp(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         channel.stop();
         position = 0;
         playPause_mc.playing = false;
         playPause_mc.gotoAndStop('play');
         obj.gotoAndStop('stop_over');
      }
      
   /********************Mute Handlers************************/
      private function MuteOver(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.isMute) {
            obj.gotoAndStop('unmute_over');
         } else {
            obj.gotoAndStop('mute_over');
         }
      }
      private function MuteOut(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.isMute) {
            obj.gotoAndStop('unmute');
         } else {
            obj.gotoAndStop('mute');
         }
      }
      private function MuteDown(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.isMute) {
            obj.gotoAndStop('unmute_down');
         } else {
            obj.gotoAndStop('mute_down');
         }
      }
      private function MuteUp(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         if(obj.isMute) {
            obj.gotoAndStop('mute_over');
            obj.isMute = false;
            channel.soundTransform = sndTrans;
         } else {
            obj.gotoAndStop('unmute_over');
            obj.isMute = true;
            channel.soundTransform = new SoundTransform(0);
         }
      }
      
   /********************Back Handlers************************/
      private function BackOver(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('back_over');
      }
      private function BackOut(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('back');
      }
      private function BackDown(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('back_down');
      }
      /*changes the List selection and then dispatches a fake ITEM_CLICK event.*/
      private function BackUp(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('back_over');
         
         if(channel.position < 1500){
            if(playList.selectedIndex == 0){
               playList.selectedIndex = playList.length -1;
               playList.scrollToSelected();
            } else {
               playList.selectedIndex--;
               playList.scrollToSelected();
            }
            playList.dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, 0, playList.selectedIndex, playList.selectedIndex, playList.selectedItem));
         }else {
            try
            {channel.stop();}
            catch(error)
            {}
            position = 0;
            if(playPause_mc.playing) {
               channel = song.play(0);
               channel.soundTransform = (mute_mc.isMute)? new SoundTransform(0) : sndTrans;
               channel.addEventListener(Event.SOUND_COMPLETE, soundComplete, false, 0, true);
            }
         }
      }
      
      
   /********************Forward Handlers************************/
      private function ForwardOver(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('forward_over');
      }
      private function ForwardOut(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('forward');
      }
      private function ForwardDown(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('forward_down');
      }
      /*changes the List selection and then dispatches a fake ITEM_CLICK event.*/
      private function ForwardUp(event:MouseEvent):void {
         var obj:Object = event.currentTarget;
         obj.gotoAndStop('forward_over');
         
         if(playList.length > playList.selectedIndex + 1){
            playList.selectedIndex++;
            playList.scrollToSelected();
         } else {
            playList.selectedIndex = 0;
            playList.scrollToSelected();
         }
         playList.dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, 0, playList.selectedIndex, playList.selectedIndex, playList.selectedItem));
      }
   }
}

RemoveChild Solution - Error #2025
So we get a lot of questions on here asking about removing movieclips and getting #2025 errors. I've written a class to help the budding Actionscripters to help them get past the errors.

Error 2025:
The error happens when you try to remove an object that isn't add to the stage or you do not specify the correct parent to remove the movieclip from.


This class does two things. It will get the correct parent object of the DisplayObject you are trying to remove. It will also silence the error so that your movie can continue to play.

This should not be a permanent fix, but actually a stepping stone used to help you learn actionscript 3 better and to prevent you from ripping your hair out.

how to use:

ActionScript Code:
import com.evride.RemoveObject;

var mc:MovieClip = new MovieClip();
RemoveObject.remove(mc); //doesn't work and just traces an error (continues to play)
addChild(mc); //adds the movieclip to the stage
RemoveObject.remove(mc); //works fine, traces nothing.


here is the class. save it in your Actionscript 3 classes folder under com
ante

ActionScript Code:
//////////////////////////////////////////
//   written by evride                  //
//   Actionscript.org forums user       //
//   found a problem? tell me there     //
//////////////////////////////////////////

package com.evride{
    public class RemoveObject{
        public static function remove(obj:Object) {
            if (obj) {
                if (obj is DisplayObject) {
                    if(obj.parent){
                        try {
                            obj.parent.removeChild(obj);
                        } catch (e:Error) {
                            trace("Couldn't remove the object. It wasn't a child of a DisplayObject.");
                        }
                    }else{
                        trace("Couldn't remove object. Parent property is null.");
                    }
                } else {
                    trace("Couldn't remove object. It is not a DisplayObject.");
                }
            } else {
                trace("Couldn't remove the object. It was null or doesn't exist.");
            }
        }
    }
}

Error #2025 When Clicking Button?
Hi i have previously posted with a problem i have been having with a site i am creating and the fact that when the buttons within a movieclip are clicked i get this error:


ActionScript Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/setChildIndex()
    at AS3PortfolioWeb_fla::MainTimeline/doDrag2()

I have no idea why i am getting this as i have never encountered this before when creating buttons that are conatined within movie clips. my origanal code read:


ActionScript Code:
web1.webBttn.addEventListener(MouseEvent.CLICK, webClick);

function webClick(e:MouseEvent):void
{
    gotoAndPlay("web");
}


Then i had a suggestion to change it too:


ActionScript Code:
stop();

var web_1:MovieClip=getChildByName("web1");

var webBttn:MovieClip = new MovieClip();

web1.getChildByName("webBttn").addEventListener(MouseEvent.CLICK, webClick);
 
web1.webBttn.addEventListener(MouseEvent.MOUSE_OVER, webOver)
web1.webBttn.addEventListener(MouseEvent.MOUSE_OUT, webOut)
//web1.webBttn.addEventListener(MouseEvent.CLICK, webClick)


function webOver(e:MouseEvent):void
{
    web1.webBttn.gotoAndStop(2);
}

function webOut(e:MouseEvent):void
{
    web1.webBttn.gotoAndStop(1);
}

function webClick(e:MouseEvent):void
{
     var request:URLRequest = new URLRequest("http://www.sg-crysis.com");
     navigateToURL(request);
}

But this still gives me the same error.CAN SOME1 PLEASE HELP ME I AM DESPERATE TO HAVE THIS SOLVED AND CANT FIGURE IT OUT! THANKS!

YOU CAN DOWNLOAD MY FLA BELOW TO SEE IF YOU CAN SPOT THE SOLUTION. THANKS

http://uploaded.to/?id=alltux

OR

http://rapidshare.com/files/14600752...tfolio_Web.zip

TimerEvent / RemoveChild() Error #2025
Hi

I'm a newbie to AS3 and need help with a TimerEvent / removeChild() problem. From a TimerEvent I'm calling a function that removes a child from the stage, except I get the following error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at intro_fla::MainTimeline/fades_six()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()

I can see the problem concerns the _timerDispatch() but am unsure how to resolve. Here's my code:

var imageData:textData = new textData(0, 0);

var imageBmpData:Bitmap = new Bitmap(imageData);
imageBmpData.x = 50;
imageBmpData.y = 50;

fades_one();

function fades_one():void {

var myDataTween:Tween = new Tween(imageBmpData, "alpha", Elastic.easeOut, 0, 100, 5000, true);
myDataTween.looping = false;

var timer:Timer = new Timer(3000, 1);
timer.addEventListener(TimerEvent.TIMER, fades_six);
timer.start();
}

function fades_six(event:TimerEvent):void {
removeChild(imageBmpData);
}

Any advice gratefully received!

CatB

AS3 - Error #2006: The Supplied Index Is Out Of Bounds.
Last edited by John B. : 2008-02-27 at 15:44.
























I am trying to navigate between the months of a calendar that I have created and I am getting the following error. When I click back to the previous month the date doesn't fall on the right day. I'm not sure what is wrong with my code.





RangeError: Error #2006: The supplied index is out of bounds.
at flash.display:: DisplayObjectContainer/removeChildAt()
at Calendar/getPreviousMonth()

ArgumentError: Error #2126: NetConnection Object Must Be Connected
I'm having a problem trying to connection to the fms3 using flash cs3. the error message that i recieved is ArgumentError: Error #2126: NetConnection object must be connected
at flash.net::NetStream/construct()
at flash.net::NetStream()]
at test_fla::MainTimeline/frame1()

I have everything setup with
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://test");

and I've try the localhost for the rtmp
nc.connect("rtmp://DReamgirls");

could anyone shed any light would gladly appreciate

Thank

Tiger

Skinning Components And Augment Error #2025
Ok so I posted about looking for a reasonable way to programatically reskin a component. I am making decent progress there, but I am running into a frustrating issue that I can't figure out. It doesn't help that Adobe's page that lists runtime errors doesn't appear to be working right now.

Anyway, I am reskinning a combobox component. There is a portion of my code that appears to be breaking things, but I don't understand why.



ActionScript Code:
/*build display objects for each skin I need to create using the color settings etc.*/

myCombo.dropdown.setRendererStyle("upSkin",upSkin);
myCombo.dropdown.setRendererStyle("overSkin",overSkin);
myCombo.dropdown.setRendererStyle("downSkin",downSkin);
myCombo.dropdown.setRendererStyle("selectedDownSkin",selDownSkin);
myCombo.dropdown.setRendererStyle("selectedOverSkin",selOverSkin);
myCombo.dropdown.setRendererStyle("selectedUpSkin",selUpSkin);

I have verified the validity of the skin objects passed in for each of those commands. If I have upskin being set at all then I get my runtime exception right away. If I don't set upskin then it will operate well with scrolling, selecting etc for a while then I will get my error after a few times opening and closing the combobox.

I get the following error:


Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at fl.controls::ComboBox/close()
at fl.controls::ComboBox/fl.controls:ComboBox::onToggleListVisibility()
If upSkin is set then I get the error almost immediately when I open a dropdown. Otherwise I can reproduce it if I do the following:
1. open the dropdown and select an item.
2. Open it and select another item.
3. open the dropdown and select the one I had previously selected.
4. try to open the dropdown.

any ideas?

any ideas????

Multiple Images In HtmlText = Error #2025
I'm thinking this is old and resolved but I can't find a solution. In FlashCS3 debugger I keep getting the error...

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.text::TextField/set styleSheet() ... set htmlText()... even touch its content

...when I set HTML content with multiple images into a TextField and then change it. No images causes no error as well as only a single image.

#2025 Error When Loading A Text Field
Hi everyone!

If you saw my last posts, I was having trouble unloading an externally loaded swf. Everything is peachy now on that score, so I'm all aflutter.

However! I have a new problem which I'm hoping you can help me with. In the same project, my externally loaded swf is a little window that can be dragged around. Within that window is a text box and five buttons. Each button loads the text box with new information via a URLLoader. Here is the code for the URLLoader:

var myURLLoader:URLLoader = new URLLoader();

myURLLoader.load(new URLRequest("bio.html"));
myURLLoader.addEventListener(Event.COMPLETE, dataLoaded);
function dataLoaded(e:Event): void {
myTfield.htmlText= myURLLoader.data;
myTfield.scrollV = 1;
}

Okay. Now, let's look at two buttons:

main_btn.addEventListener(MouseEvent.CLICK, albumText);
function albumText(e:MouseEvent): void {
myURLLoader.load(new URLRequest("bio.html"));
}

anth_btn.addEventListener(MouseEvent.CLICK, lyricsText);
function lyricsText(e:MouseEvent): void {
myURLLoader.load(new URLRequest("anth.html"));
}

Everything looks fine, right? And the mechanism works at runtime, BUT, there is an annoying glitch that for the life of me I cannot fathom. Sometimes, and usually after I drag the clip around a bit, I get this error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.text::TextField/set htmlText()
at bio_fla::MainTimeline/dataLoaded()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n
()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

Can anyone help me figure out why I'm getting this crazy error? What supplied DisplayObject is the Flash Player saying is not a child of the caller??

Thanks. I've attached the files for your parusal.

RangeError: Error #2006: The Supplied Index Is Out Of Bounds.
I am getting this error most unexpectedly


Quote:




RangeError: Error #2006: The supplied index is out of bounds.




the code in question is:


ActionScript Code:
function loadedMiniSwf(e:Event):void
{
    trace("loaded swf");
    myExtSwf = e.currentTarget.content;
    //I have also tried:
    // myExtSwf = (MovieClip(e.currentTarget.content));
    // myExtSwf = (MovieClip(loader.content));
    // but still get the same error....
                   
               
    addChild(myExtSwf);
                   
    myExtSwf.addEventListener(MouseEvent.CLICK, handler);
}

Its rather late so I may be completely missing it but it looks fine and runs fine, it all still works however it gives me the above error at runtime...?

RangeError: Error #2006: The Supplied Index Is Out Of Bounds.
Hi Guys
I am making an Auto-Arrange button and clicking on which arranges all the children of the container( which are on the main stage) in the tile format. Basically on clicking, I manually move those child on the stage to particular coordinates as shown in my code. I have pasted my code below. My problem is that as soon as i click on the auto arrange button I am getting error "RangeError: Error #2006: The supplied index is out of bounds.". Please let me know what i am doing wrong and i will appreciate if you let me know how would i fix this
Thanks a lot guys
Anuj

******************CODE**********************
var aa:Number=0;
var xcoord:Number=-300;
var ycoord:Number=-200;
var xcoord1:Number=450;
var xcoord2:Number=850;
var xcoord3:Number=1250;
var ycoord1:Number=350;
var ycoord2:Number=650;
//Button Listener
btn_AA.addEventListener(MouseEvent.CLICK,autoArrange);
function autoArrange(event:MouseEvent):void
{
if(container.getChildAt(aa)!=null)
{
container.getChildAt(aa).x=xcoord;
container.getChildAt(aa).y=ycoord;
//Arrange Second
container.getChildAt(aa+1).x=xcoord+xcoord1;
container.getChildAt(aa+1).y=ycoord;
//Arrange Third
container.getChildAt(aa+2).x=xcoord+ xcoord2;
container.getChildAt(aa+2).y=ycoord;
//Arrange Forth
container.getChildAt(aa+3).x=xcoord+xcoord3;
container.getChildAt(aa+3).y=ycoord;
//Arrange Fifth
container.getChildAt(aa+4).x=xcoord;
container.getChildAt(aa+4).y=ycoord+ycoord1;
//Arrange Sixth
container.getChildAt(aa+5).x=xcoord+xcoord1;
container.getChildAt(aa+5).y=ycoord+ycoord1;
//Arrange Seventh
container.getChildAt(aa+6).x=xcoord+ xcoord2;
container.getChildAt(aa+6).y=ycoord+ycoord1;
//Arrange Eight
container.getChildAt(aa+7).x=xcoord+xcoord3;
container.getChildAt(aa+7).y=ycoord+ycoord1;
//Arrange Ninth
container.getChildAt(aa+8).x=xcoord;
container.getChildAt(aa+8).y=ycoord+ycoord2;
//Arrange Tenth
container.getChildAt(aa+9).x=xcoord+xcoord1;
container.getChildAt(aa+9).y=ycoord+ycoord2;
//Arrange Eleventh
container.getChildAt(aa+10).x=xcoord+ xcoord2;
container.getChildAt(aa+10).y=ycoord+ycoord2;
}
}

Copyright © 2005-08 www.BigResource.com, All rights reserved