Popping cursor

hi.
i had an earlier post about an interactive scene with bubbles. i’ve just updated the code and works quite well except the pin cursor that is meant to pop the bubbles is still not working.
could anyone help?

here is the code:
main class

ActionScript Code:
[LEFT]package[COLOR=#000000]{[/COLOR] [COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]display[/COLOR].; [COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]events[/COLOR].; [COLOR=#993300]public[/COLOR] [COLOR=#993300]class[/COLOR] main [COLOR=#993300]extends[/COLOR] [COLOR=#993300]MovieClip[/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#993300]private[/COLOR] [COLOR=#993300]var[/COLOR] myBubble:Bubble; [COLOR=#993300]public[/COLOR] [COLOR=#993300]function[/COLOR] mainCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#993300]for[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]var[/COLOR] i:[COLOR=#993300]int[/COLOR] = [COLOR=#000000]0[/COLOR]; i < [COLOR=#000000]15[/COLOR]; i++[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR] myBubble = [COLOR=#993300]new[/COLOR] BubbleCOLOR=#000000[/COLOR]; addChildCOLOR=#000000[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR]
[/LEFT]

bubble class

ActionScript Code:
[LEFT]package [COLOR=#000000]{[/COLOR] [COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]display[/COLOR].; [COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]events[/COLOR].; [COLOR=#993300]public[/COLOR] [COLOR=#993300]class[/COLOR] Bubble [COLOR=#993300]extends[/COLOR] Sprite [COLOR=#000000]{[/COLOR] [COLOR=#993300]var[/COLOR] angle:[COLOR=#993300]Number[/COLOR]; [COLOR=#993300]var[/COLOR] randomSpeed:[COLOR=#993300]Number[/COLOR]; [COLOR=#993300]var[/COLOR] theParent:[COLOR=#993300]Object[/COLOR]; [COLOR=#993300]public[/COLOR] [COLOR=#993300]function[/COLOR] BubbleCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR] theParent = theParent; angle = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]random[/COLOR]COLOR=#000000[/COLOR] * [COLOR=#000000]140[/COLOR] - [COLOR=#000000]200[/COLOR]; randomSpeed = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]random[/COLOR]COLOR=#000000[/COLOR] * [COLOR=#000000]10[/COLOR]; [COLOR=#993300]this[/COLOR].[COLOR=#000000]x[/COLOR] = theParent.[COLOR=#993300]stage[/COLOR].[COLOR=#000000]stageWidth[/COLOR]/[COLOR=#000000]2[/COLOR].[COLOR=#000000]5[/COLOR]; [COLOR=#993300]this[/COLOR].[COLOR=#000000]y[/COLOR] = theParent.[COLOR=#993300]stage[/COLOR].[COLOR=#000000]stageHeight[/COLOR]-[COLOR=#000000]150[/COLOR]; [COLOR=#993300]this[/COLOR].[COLOR=#000000]scaleX[/COLOR] = [COLOR=#993300]this[/COLOR].[COLOR=#000000]scaleY[/COLOR] = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]random[/COLOR]COLOR=#000000[/COLOR]; addEventListenerCOLOR=#000000[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#993300]public[/COLOR] [COLOR=#993300]function[/COLOR] floatUpCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR] [COLOR=#993300]var[/COLOR] radian:[COLOR=#993300]Number[/COLOR] = angle * [COLOR=#993300]Math[/COLOR].[COLOR=#993300]PI[/COLOR]/[COLOR=#000000]400[/COLOR]; [COLOR=#993300]var[/COLOR] vx:[COLOR=#993300]Number[/COLOR] = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]ceil[/COLOR]COLOR=#000000[/COLOR] * randomSpeed; [COLOR=#993300]var[/COLOR] vy:[COLOR=#993300]Number[/COLOR] = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]sin[/COLOR]COLOR=#000000[/COLOR] * randomSpeed; [COLOR=#993300]this[/COLOR].[COLOR=#000000]x[/COLOR] += vx; [COLOR=#993300]this[/COLOR].[COLOR=#000000]y[/COLOR] += vy; [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR][COLOR=#000000]}[/COLOR]
[/LEFT]

pin class

ActionScript Code:
[LEFT]package[COLOR=#000000]{[/COLOR] [COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]display[/COLOR].; [COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]events[/COLOR].; [COLOR=#993300]public[/COLOR] [COLOR=#993300]class[/COLOR] Pin [COLOR=#993300]extends[/COLOR] [COLOR=#993300]MovieClip[/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#993300]var[/COLOR] mypin = [COLOR=#993300]new[/COLOR] PinCOLOR=#000000[/COLOR]; [COLOR=#993300]public[/COLOR] [COLOR=#993300]function[/COLOR] addPinCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR] addEventListenerCOLOR=#000000[/COLOR]; addChildCOLOR=#000000[/COLOR]; mypin.[COLOR=#000000]x[/COLOR] = mouseX; mypin.[COLOR=#000000]y[/COLOR] = mouseY; mypin.[COLOR=#993300]startDrag[/COLOR]COLOR=#000000[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#993300]public[/COLOR] [COLOR=#993300]function[/COLOR] floatUpCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR] evt.[COLOR=#993300]target[/COLOR].[COLOR=#000000]y[/COLOR] -= evt.[COLOR=#993300]target[/COLOR].[COLOR=#000000]theParent[/COLOR]; [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]evt.[COLOR=#993300]target[/COLOR].[COLOR=#000000]hitTestPoint[/COLOR][COLOR=#000000]([/COLOR]mypin.[COLOR=#000000]x[/COLOR] - mypin.[COLOR=#993300]width[/COLOR] / [COLOR=#000000]2[/COLOR], mypin.[COLOR=#000000]y[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR] evt.[COLOR=#993300]target[/COLOR].[COLOR=#000000]removeEventListener[/COLOR]COLOR=#000000[/COLOR]; evt.[COLOR=#993300]target[/COLOR].[COLOR=#000000]theParent[/COLOR].[COLOR=#000000]removeChild[/COLOR]COLOR=#000000[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR][COLOR=#000000]}[/COLOR]
[/LEFT]

sorry about the code. i didnt write it like that

main class
<as>
package{

import flash.display.;
import flash.events.
;

public class main extends MovieClip{

private var myBubble:Bubble;

public function main(){
for(var i:int = 0; i < 15; i++){
myBubble = new Bubble(this);
addChild(myBubble);
}
}
}
}

</as>

bubble class
<as>
package {
import flash.display.;
import flash.events.
;
public class Bubble extends Sprite {
var angle:Number;
var randomSpeed:Number;
var theParent:Object;
public function Bubble(theParent) {
theParent = theParent;
angle = Math.random() * 140 - 200;
randomSpeed = Math.random() * 10;
this.x = theParent.stage.stageWidth/2.5;
this.y = theParent.stage.stageHeight-150;
this.scaleX = this.scaleY = Math.random();
addEventListener(Event.ENTER_FRAME,floatUp);
}
public function floatUp(evt:Event) {
var radian:Number = angle * Math.PI/400;
var vx:Number = Math.ceil(radian) * randomSpeed;
var vy:Number = Math.sin(radian) * randomSpeed;
this.x += vx;
this.y += vy;
}
}
}
</as>

pin class
<as>
package{

import flash.display.;
import flash.events.
;

public class Pin extends MovieClip{
var mypin = new Pin();

public function addPin(evt:Event){

addEventListener(MouseEvent.MOUSE_DOWN,addPin);
addChild(mypin);
mypin.x = mouseX;
mypin.y = mouseY;
mypin.startDrag(true);
}

public function floatUp(evt:Event) {
evt.target.y -= evt.target.theParent;
if (evt.target.hitTestPoint(mypin.x - mypin.width / 2, mypin.y, true)) {
evt.target.removeEventListener(Event.ENTER_FRAME,floatUp);
evt.target.theParent.removeChild(evt.target);
}
}
}
}
</as>

THE CODE AGAIN

from what i can see you never actually create the addPin event except for inside the function addPin.

thats like locking your keys inside your car, quite literally.

lol.
so how do i fix this. sorry im a beginner and im trying to learn by doing. your help is great!

well unfortunately i use flash cs3 so chucking the code in to test it wont work.

You need to mode the addeventlistener to the main movie. you need to create the pin instance and add it from the main movie.

you can send me the files if you like and I’ll sort it from there.

hey here are the files.
i cant send the .fla its actualy to big…

is this a big process or is it quite simple

any luck? ive tried but im not having much luck at all lol