Okay, so basically i have a movieclip on the screen and a function which loads a picture into it when it enters the frame. But i also have a function which makes it rise and grow when it is rolled over and it worked fine until i added the loader because now it seems to have converted the whole clip to a loader or something because it tells me :
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@32be3101 to flash.display.Sprite.
at Thisflashfile_fla::galleryInnerEndMc_26/…
this is the code:
gb1_mc.addEventListener(MouseEvent.MOU… mainLift); //Event listeners for the movieclip
gb1_mc.addEventListener(MouseEvent.MOU… mainDrop); //for when it is rolled over
function mainLift(event:MouseEvent):void { //function to make it rise on rollover
var thisOne:Sprite = Sprite(event.target)
thisOne.y -= 15
thisOne.x -= 10
thisOne.width += 20
}
function mainDrop(event:MouseEvent):void { //function to make it fall on rollout
var thisOne:Sprite = Sprite(event.target)
thisOne.y += 15
thisOne.x += 10
thisOne.width -= 20
} //all this works fine untill i added this:
gb1_mc.addEventListener(Event.ENTER_FR… addPicMain) //event listener for when it enters frame
function addPicMain(event:Event):void {
var picNum:Number = 1 //there are alot of them so i have a picture number variable
var imgRequest:URLRequest = new URLRequest("/galImgs/pic" + picNum + ".png"); //image location
var imgLoader:Loader = new Loader (); //creates loader
imgLoader.load(imgRequest); //loads it
event.target.addChild(imgLoader); //adds it to the movieclip*
}
*So i think this is where it screws up maybe the loader is going overtop of the movieclip causeing the other code not to work. Idk so if anyone could help it would be greatly appreciated if ur good with flash this is easy ten pts :) if i havnt done a good job explainign just ask
Thanks in advance
Sorry if thats bad i copied and pasted from last night i asked on yahoo answers but this place is obviously better so i ask here too :)