StartDrag problem?

I'm building a simple map application, where users can click
on the map and drag it around. Pretty basic idea. The map is an
extended Canvas, nested inside of a parent container which is also
a Canvas. When someone clicks on the map, I call startDrag, and on
release I stop it. Still pretty basic. The problem I'm having is
that whenever a user clicks on the map, they can sometimes drag the
map right outside of the parent container. I'm not sure how to fix
this, is it a bug? Or am I missing something?
I've put together a simple example of what I'm talking about.
http://webdojo.net/flex/
If you click on the red square and drag it, I want that to
stay in the white square. It makes sense to me that it should be
default, but you can drag the red square out of its parent. Notice
when you release it goes back into its parent, and you see
scrollbars to its position.
Here's the source view:
http://webdojo.net/flex/srcview/
I've tried setting clipContents to true on the parent Canvas,
but it seems to do nothing. Any ideas?

Im getting the problem now.
The problem is, when i release the mouse with other MC in
front of mine he doesnt drop it and the mc stay following my mouse.
I thought that by using the getNextHighestDepth i would solve
it, but guess not :(
Any idea how to do this please?
I am using object to make the mouse stuff like:
var meuObject:Object = new Object();
meuObject.onRollOut = function(){
apagarTexto();
meuObject.onPress = function(){
var novaDepth= this.getNextHighestDepth();
this.swapDepths(novaDepth);
this.startDrag();
meuObject.onRelease = function() {
botoes(this);
for (i=0;i<6;i++){
var newDepth = this.getNextHighestDepth();
var newMC:String = "botaoMenu" + String(i);
this.attachMovie(newMC,newMC,newDepth,meuObject);
}

Similar Messages

  • Problem with startDrag

    Hello guys, im having some issues with a movieclip drag.
    many times, it just dont work how it was supposed to.
    i press and then it doesnt work, or sometimes i press and the
    movieclip goes away. weel many strange thing.
    this is by code:
    botaoProblemas.onPress = function() {
    this.startDrag();
    botaoProblemas.onRelease = function() {
    botoes(this);
    function botoes(mc:MovieClip) {
    mc.stopDrag();
    // and some random things
    you can check what i am saying here:
    http://www.imauro.com/monografia/
    i thought it could be something with my movieclip but i
    copy/paste it from ilustrator and then just hit F8 and make a
    movieclip with Reg TL.
    any ideas how to make the bets out of drag? or something i
    need to take care of?
    thank you

    Im getting the problem now.
    The problem is, when i release the mouse with other MC in
    front of mine he doesnt drop it and the mc stay following my mouse.
    I thought that by using the getNextHighestDepth i would solve
    it, but guess not :(
    Any idea how to do this please?
    I am using object to make the mouse stuff like:
    var meuObject:Object = new Object();
    meuObject.onRollOut = function(){
    apagarTexto();
    meuObject.onPress = function(){
    var novaDepth= this.getNextHighestDepth();
    this.swapDepths(novaDepth);
    this.startDrag();
    meuObject.onRelease = function() {
    botoes(this);
    for (i=0;i<6;i++){
    var newDepth = this.getNextHighestDepth();
    var newMC:String = "botaoMenu" + String(i);
    this.attachMovie(newMC,newMC,newDepth,meuObject);
    }

  • Problems with startDrag()

    Has anyone else had problems with Sprite#startDrag() when
    using the optional parameters?
    According to the documentation, I should be able to compile
    something like:
    tile.startDrag( true, tile.parent.getBounds());
    This behavior is documented as:
    public function startDrag(lockCenter:Boolean = false,
    bounds:Rectangle = null):void
    where the first parameter says "center the sprite on the
    mouse" rather than where the use clicked and the second parameter
    constrains the movement of the sprite to the bounding box, measured
    in the Sprite's parent's coordinates.
    However, when I go to compile this, the first error I get is
    that Sprite#startDrag() only accepts one argument:
    mover.mxml(17): Error: Incorrect number of arguments.
    Expected 1.
    t.startDrag( false, t.parent.getBounds());
    Ooops...which one? It turns out it only takes the less useful
    one (lockCenter). However, when I try:
    tile.startDrag( true);
    I do not get the described behavior at all. Instead, the
    mouse is locked to 0,0 on the Sprite and the mouseUp will not work
    at all (the Sprite gets "stuck" to the mouse). If I go back to:
    tile.startDrag();
    everything works as expected but I still can drag the Sprite
    anywhere I want. This is not the desired behavior. Here is some
    code to test that this is the case on other systems, here:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="600" height="400" creationComplete="init();">
    <mx:Script>
    <![CDATA[
    import flash.events.MouseEvent;
    public function init(): void {
    tile.addEventListener( MouseEvent.MOUSE_DOWN,
    handleMouseDown);
    tile.addEventListener( MouseEvent.MOUSE_UP, handleMouseUp);
    public function handleMouseDown( event: MouseEvent): void {
    var t : Canvas = Canvas( event.target);
    t.addEventListener( MouseEvent.MOUSE_MOVE, handleMouseMove);
    // t.startDrag( true); // the default is false
    t.startDrag( false, t.parent.getBounds());
    // t.startDrag();
    public function handleMouseUp( event: MouseEvent): void {
    var t : Canvas = Canvas( event.target);
    t.removeEventListener( MouseEvent.MOUSE_MOVE,
    handleMouseMove);
    t.stopDrag();
    public function handleMouseMove( event: MouseEvent): void {
    var t : Canvas = Canvas( event.target);
    event.updateAfterEvent();
    ]]>
    </mx:Script>
    <mx:Panel id="pallette" height="100%" width="100%"
    clipContent="true">
    <mx:Canvas id="tile" x="25" y="25" width="25" height="25"
    backgroundColor="red"/>
    </mx:Panel>
    </mx:Application>

    okay, duh. The problem is not that Sprite#dragStart() has the
    wrong number of arguments. getBounds() has the wrong number of
    arguments.
    Need better error reporting from the compiler...it should say
    which method was expecting 1 argument.

  • StartDrag Basic Problem

    Hi,
    I am starting to find my way in AS3.
    I use startDrag in the code and it works. But when I try
    stopDrag it doesn't stop to drag.
    I hope somebody can tell me what I am doing wrong?
    Thanks
    Here is my code:

    you're removing your mouseup listener when you
    startdrag.

  • Problems with ListViews Drag and Drop

    I'm surprised that there isn't an Active X control that can do this more
    easily? Would
    be curious to find out if there is - although we aren't really embracing the
    use of
    them within Forte because it locks you into the Microsoft arena.
    ---------------------- Forwarded by Peggy Lynn Adrian/AM/LLY on 02/03/98 01:33
    PM ---------------------------
    "Stokesbary, Michael" <[email protected]> on 02/03/98 12:19:52 PM
    Please respond to "Stokesbary, Michael" <[email protected]>
    To: "'[email protected]'" <[email protected]>
    cc:
    Subject: Problems with ListViews Drag and Drop
    I am just curious as to other people's experiences with the ListView
    widget when elements in it are set to be draggable. In particular, I am
    currently trying to design an interface that looks a lot like Windows
    Explorer where a TreeView resides on the left side of the window and a
    ListView resides on the right side. Upon double clicking on the
    ListView, if the current node that was clicked on was a folder, then the
    TreeView expands this folder and the contents are then displayed in the
    ListView, otherwise, it was a file and it is brought up in Microsoft
    Word. All this works great if I don't have the elements in the ListView
    widget set to be draggable. If they are set to be draggable, then I am
    finding that the DoubleClick event seems to get registered twice along
    with the ObjectDrop event. This is not good because if I double click
    and the current node is a folder, then it will expand this folder in the
    TreeView, display the contents in the ListView, grab the node that is
    now displayed where that node used to be displayed and run the events
    for that as well. What this means, is that if this is a file, then Word
    is just launched and no big deal. Unfortunately, if this happens to be
    another directory, then the previous directory is dropped into this
    current directory and a recursive copy gets performed, giving me one
    heck of a deep directory tree for that folder.
    Has anybody else seen this, or am I the only lucky one to experience.
    If need be, I do have this exported in a .pex file if anybody needs to
    look at it more closely.
    Thanks in advance.
    Michael Stokesbary
    Software Engineer
    GTE Government Systems Corporation
    tel: (650) 966-2975
    e-mail: [email protected]

    here is the required code....
    private static class TreeDragGestureListener implements DragGestureListener {
         public void dragGestureRecognized(DragGestureEvent dragGestureEvent) {
         // Can only drag leafs
         JTree tree = (JTree) dragGestureEvent.getComponent();
         TreePath path = tree.getSelectionPath();
         if (path == null) {
              // Nothing selected, nothing to drag
              System.out.println("Nothing selected - beep");
              tree.getToolkit().beep();
         } else {
              DefaultMutableTreeNode selection = (DefaultMutableTreeNode) path
                   .getLastPathComponent();
              if (selection.isLeaf()) {
              TransferableTreeNode node = new TransferableTreeNode(
                   selection);
              dragGestureEvent.startDrag(DragSource.DefaultCopyDrop,
                   node, new MyDragSourceListener());
              } else {
              System.out.println("Not a leaf - beep");
              tree.getToolkit().beep();
    }

  • Problem with drag and drop

    Hi! I'm having a problem with getting this code working, basically I want to drag and drop two things onto another the things dissapear then it moves onto a new page, the first item works properly but then the second item wont dissapear and remains stuck to the cursor. Heres the code I'd be greatful of any help.
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    stop();
    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)
    function onBack6Click(event:MouseEvent):void{
        gotoAndPlay("Bedroom2");
        Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)
    function onForward6Click(event:MouseEvent):void{
        gotoAndPlay('Brother bit');
    var inGran:Number=0;
    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    function dragOn(event:MouseEvent):void {
        event.target.startDrag(false);
        stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);
    function dragOff(event:MouseEvent):void {
        event.target.stopDrag();
        if (event.target.dropTarget!=null&&event.target.dropTarget.parent==Gran) {
            event.target.visible=false;
            inGran++;
        stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);
    function checkPage(e:Event):void {
        if (inGran==2) {
            gotoAndPlay("Bedroom1");

    you have some mismatched brackets, change your target properties to currentTarget (and i'm not sure you're dropping onto the correct target) but, try:
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    stop();
    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)
    function onBack6Click(event:MouseEvent):void{
        gotoAndPlay("Bedroom2");
        Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)
    function onForward6Click(event:MouseEvent):void{
        gotoAndPlay('Brother bit');
    var inGran:Number=0;
    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    function dragOn(event:MouseEvent):void {
    event.currentTarget.parent.addChild(event.currentTarget);
        event.target.startDrag(false);
        stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);
    function dragOff(event:MouseEvent):void {
        event.target.stopDrag();
        if (event.target.dropTarget!=null&&event.target.dropTarget.parent==Gran) {
            event.target.visible=false;
            inGran++;
        stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);
    function checkPage(e:Event):void {
        if (inGran==2) {
            gotoAndPlay("Bedroom1");

  • Please can anyone solve this problem...it's taking over my life!!

    Hi, I hope someone can hep me with this as it's driving me crazy!!...I have a magnify glass effect for my main movie and everything is working great, except I need the magnify glass to stay within certain boundaries on the stage...basically when someone moves there mouse away from the flash movie in the centre of the page in a browser, it cuts off the glass and it looks funny (see www.zoeglazebrook.co.uk)...
    Kglad has very kindly donated many hours to trying to solve this but it still isn't working unfortunately.
    This is the code on the main timeline, and I just need to add in 125, 127, 1095, 775 coordinates in there to make it not go past these points on the stage:
    var moveGlass:Number;
    magnifyingGlass.onPress = function() {
        moveGlass = setInterval(startGlass,1);
    function startGlass() {
        magnifyingGlass._x = _root._xmouse;
        magnifyingGlass._y = _root._ymouse;
    magnifyingGlass.onEnterFrame = function(){
         this.largeobject._x = (this._parent.original._x-this._x)*2;
         this.largeobject._y = (this._parent.original._y-this._y)*2;

    I'm not sure I understand your question.
    I think you are asking about how once you start clicking it doesn't go off? You can add something like this:
    magnifyingGlass.onRelease=magnifyingGlass.onReleaseOutside=function(){
    delete this.onEnterFrame;
    If I'm following you correctly. Or not.
    I'm actually more annoyed by also having the pointer still show. So you might add a Mouse.hide() when they press and a Mouse.unhide() when they release. BTW, you need the onReleaseOutside because if you are limiting where the magnifying glass can be dragged then the pointer might not be above the glass when they release. Most people forget the onReleaseOutside and it causes a lot of problems.
    Also I'm confused about your confusion of "...whether it's better to have a start drag on there instead."
    startDrag() does just that. It takes the item that is referenced and makes it follow the pointer. And it also gives you an easy way to limit the bounds of that dragging to a rectangle. However you can only drag one thing at a time using startDrag and there is no way to do other things as you drag.
    In this case you need to also reposition the large view at the same time based upon the position of the pointer. Therefore you need some other kind of loop that says, "every little bit of time make the glass match the mouse coordinates and also align the large image." You could probably make some kind of combined solution that starts the magnifying glass moving with startDrag and uses an onEnterFrame to position the large view, but why make it more complex than it needs to be?

  • [F8] Problem with scrip when targeting player 8

    When I target the flash 8 player my scripts wont work and I
    cant figure out why. Here is what I have (forgive me if my
    explanations arent up to snuff)
    On my tracker button
    Code:
    on (rollOver) {
    startDrag("/tracker", true);
    On my first frame
    Code:
    mover = getProperty("scrollingobject", _x);
    On my second frame
    Code:
    mouseh = getProperty("/tracker", _x);
    mousev = getProperty("/tracker", _y);
    if (Number(mousev)>325 and Number(mousev)<348) {
    movevalue =
    (Number(movevalue*5)+Number(((mouseh-320)/-12)))/10;
    setProperty("/alert", _visible, true);
    } else {
    movevalue = 0;
    setProperty("/alert", _visible, false);
    On my third frame
    Code:
    mover = Number(mover)+Number(movevalue);
    if (Number(mover)>1250) {
    mover = 0;
    if (Number(mover)<0) {
    mover = 1250;
    setProperty("/scrollingobject", _x, mover);
    gotoAndPlay(59);
    Basicaly the text scrolls right and left in conjuction with
    the "tracker" button. I learned how to do this from one of the
    flash kit files that I will try and locate.
    But the problem with this is that it only works in the flash
    6 player and I need to target the flash 8 player
    Any responce would be great.
    P.S. My fla can be found here
    http://www.myapartmentbar.com/F8prob.fla
    http://www.myapartmentbar.com/F8prob.fla">http://www.myapartmentbar.com/F8prob.fla

    Long shot, but...
    Open Audio Midi Setup in Applications>Utilities, see the input & output options & KHz setting there, some things will change it for their own use, then not set it back.
    Open Console in Applications>Utilities & see if there are any clues or repeating messages when this happens.

  • StartDrag constrain to Rectangle

    hi there
    please can somoe help with this little problem, I have a demo file that I am trying to created a constraint to a rectangle. I have the startDrag working and I am trying to constrain a square to the movie size of 600x400.
    I have been searching online help files but I can not for the life of me get it to work, would someone beable to put me out of my misery. I have attached the demo file I am working with but I will also post my script here for thoughs who prefer that.....going crazy, can any help, does it have to be this difficult...aarrrghh!!
    this is what I thought I could simply add
    animation", false, 0, 0, 300, 300);
    but know joy....anyone help   : (
    my code:
    ////Button Listeners/////////////
    // BtnNav listeners
    btnNav.addEventListener(MouseEvent.ROLL_OVER, btnNavOver);
    btnNav.addEventListener(MouseEvent.ROLL_OUT, btnNavOut);
    btnNav.addEventListener(MouseEvent.CLICK, btnNavDown);
    // change: made the graphic "red shape" a movieClip and made redShape and closeBtn a movieClip
    // added this listener to that button...
    animation.redShape.closeBtn.addEventListener(MouseEvent.MOUSE_UP,closeUp);
    ////for the click and drag
    animation.addEventListener(MouseEvent.MOUSE_DOWN,dragStart);
    animation.addEventListener(MouseEvent.MOUSE_UP,dragStop);
    ///////button 1 function ///////////
    // BtnNav Over function
    function btnNavOver(event:MouseEvent):void {
    btnNav.gotoAndPlay("over"); // go into btn1 movieclip and play the over frame label
    // BtnNav Out function
    function btnNavOut(event:MouseEvent):void {
    btnNav.gotoAndPlay("out"); // go into btn1 movieclip and play the out frame label
    //animation.stopDrag();
    // BtnNav Down function
    function btnNavDown(event:MouseEvent):void {
    // change: tell the movieClip animation to play...
    animation.play();
    //this.gotoAndPlay("animation");
    // play any frame label in any movieclip
    // change: added this function for the close button to have it play the animation clip...
    function closeUp(event:MouseEvent):void {
    animation.play();
    /////for the click and drag////
    function dragStart(event:MouseEvent):void {
        event.currentTarget.startDrag();
    //("animation", false, 0, 0, 300, 300);
    function dragStop(event:MouseEvent):void {
        stopDrag();

    I'm afraid it does not get simpler than this (AFAIK).
    Here's the (stripped down version) you could use:
    import flash.geom.Rectangle;
    ////Button Listeners/////////////
    ////for the click and drag
    animation.addEventListener(MouseEvent.MOUSE_DOWN,dragStart);
    animation.addEventListener(MouseEvent.MOUSE_UP,dragStop);
    /////for the click and drag////
    function dragStart(event:MouseEvent):void {
        event.currentTarget.startDrag( false, new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight ) );
    function dragStop(event:MouseEvent):void {
        stopDrag();
    The rectangle created defines the bounds in which the movieClip "animation" is dragged.
    The registrationpoint of the movieClip "animation" will remain within these bounds. If you want the whole clip to remain within these bounds easiest is to have the registrationpoint in the middle of the clip and defin the rect like:
        var d:DisplayObject = DisplayObject( event.currentTarget );
        var r:Rectangle = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );
        r.inflate( -d.width / 2, -d.height / 2 );
        event.currentTarget.startDrag( false, r );
    Just some handy methods of the Rectangle object to inflate (or shrink) a rectangle.

  • Some strange problem with Flash/As3

    Hi,
    I am having some strange problem with my flash cs3.
    Whatever script I write in as3  doesn't work, even a stop() function doesn't work . But when I change my publish setting to as2 it works fine.
    Not sure about the root cause, may be some setting or preference or my cs3 is corrupted.
    Can anybody please advise.
    Thanks,
    Kishor

    try this
    create a new fla as3,
    select frame 1
    open the actions panel
    paste in the following code
    var squares:Array = new Array;
    setup();
    function setup():void {
        for (var i = 0; i < 25; i++) {
            var square:Sprite = new Sprite();
            //square.name = "square" + i;
            square.graphics.beginFill(Math.random() * 0xffffff);
            squares.push(square);
            squares[i].graphics.drawRect(0, 0, 100, 100);
            squares[i].x = i*3;
            squares[i].y = i*3;
            squares[i].filters = [];
            square.graphics.endFill();
            stage.addChild(squares[i]);
    for (var j = 0; j < squares.length; j++) {
        squares[j].addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
        squares[j].addEventListener(MouseEvent.MOUSE_UP, dropMovie);
        squares[j].buttonMode = true;
    function dragMovie(event:MouseEvent):void {
        event.target.startDrag();
    function dropMovie(event:MouseEvent):void {
        event.target.stopDrag();

  • AS2/CS4 Netstream problem...

    I'm currently building a custom flv player and need some help.  Maybe I'm missing something, I'm not sure.  The main problem is that the FLV doesn't load/play, which most likely causes the secondary problems, such as the bufferClip always visible and no way to test the video and audio scrubbers.
    ----CODE----
    var nc: NetConnection = new NetConnection();
    nc.connect(null);
    var ns: NetStream = new NetStream(nc);
    ns.setBufferTime(5);
    ns.onStatus = function(info){
    if(info.code == "NetStream.Buffer.Full"){
      bufferClip._visible=false;
    if(info.code == "NetStream.Buffer.Empty"){
      bufferClip._visible=true;
    if(info.code == "NetStream.Play.Stop"){
      gotoAndStop("end");
    //video location
    videoPlace.attachVideo(ns);
    ns.play("URL of FLV");
    //audio control
    _root.createEmptyMovieClip("vSound",_root.getNextHighestDepth())
    vSound.attachAudio(ns);
    var so:Sound = new Sound(vSound);
    audioControl.audioScrub.onEnterFrame=function(){
    so.setVolume(100-this._y);
    audioControl.audioScrub.onPress=function(){
    this.startDrag(false,this._x,0,this._y,100);
    audioControl.audioScrub.onRelease = audioControl.audioScrub.onReleaseOutside = function(){
    this.stopDrag();
    //restart button
    controlBar.restartBtn.onRelease = function(){
    ns.seek(0);
    //Play and Pause button
    controlBar.playpause.onRelease = function(){
    ns.pause();
    //setup the video interval
    var vidInt = setInterval(videoStatus, 100);
    var amtLoad:Number;
    var duration:Number;
    ns["onMetaData"] = function(obj){
    duration = obj.duration;
    function videoStatus(){
    amtLoad = ns.bytesLoaded/ns.bytesTotal;
    loader_mc.loadBar._width = amtLoad * 560;
    loader_mc.scrubber._x = ns.time/duration * 560;
    //scrubber code
    var scrubInt;
    loader_mc.scrubber.onPress = function(){
    clearInterval(vidInt);
    scrubInt = setInterval(scrubIt,10);
    this.startDrag(false,0,this._y,560,this._y);
    loader_mc.scrubber.onRelease = loader_mc.scrubber.onReleaseOutside = function(){
    clearInterval(vidInt);
    vidInt = setInterval(videoStatus,100);
    this.stopDrag();
    function scrubIt(){
    ns.seek(Math.floor((controlBar.loader_mc.scrubber._x/560) * duration));
    ----END CODE----
    Thank you for your help in advance.  If you need anymore info, just let me know.
    ~gray14

    Okay, I did that.  The video loads and plays, which is good.  Now a couple more problems come to light:
    1) The video scrubber (_root.loader_mc.scrubber) drags where it should, but the video doesn't react as it should.  The video should play at the time that corresponds with the position of the scrubber.
    2) There is no sound, which I'm guessing has to do with that audioControl and audioScrub code I wrote.
    Never mind that second one.  I had the sound turned off on my PC ((stupid me, lol)).  I have another question, purely for asthetic reasons:
    How do I write the code so the playpause button changes from a play symbol to a pause symbol when paused and vice versa?

  • StartDrag in 3D not working

    The Language Reference states:
    "Three-dimensional display objects follow the mouse and        Sprite.startDrag() moves the object within       the three-dimensional plane defined by the display object. Or, if the  display object is a two-dimensional object       and the child of a three-dimensional object, the two-dimensional  object        moves within the three dimensional plane defined by the  three-dimensional parent object."
    However, this does not seem to be the case.  I have a 2D object which is the child of a 3D object, but startDrag will not work on the child.  If I remove any tweens in code from the parent's rotationY then startDrag will work.    If I have any reference to rotationY it will not work, even if it is set to 0.
    I found this post about reseting the matrix: http://forums.adobe.com/message/978511#978511   Which A. is a hack/workaround and B. I can't seem to get to work in my case.
    Digging further this seems to be a bug that was fixed in Flash 10 back in Oct 2008: http://labs.adobe.com/technologies/flashplayer10/releasenotes.html.  However, I have the latest Flash player and it is not working for me.
    Fluke or do other people experience the same problem and I should re-submit the bug?
    Thanks

    I am not sure but, given the fact that 3D is not really 3D but a Bitmap object's representation redrawn, you cannot interact with the object inside Bitmap for there is none - again, it is a single Bitmap.
    I see that the only way to preserve interactivity is to render each object separately.

  • Scrubber problems continued. AS2/Flash CS3

    Hey guys. I'm having troubles with my scrubber on my loadbar again.
    As a picture says a 1000 words heres a screenshot of the problem:
    Basically the scrubber bar is going waaaay past the 373px I asked to stop at.
    I've tried messing about with telling scrubber_mc to stop at the end of ._x of the loadbar clip but have had no luck.
    Anybody with suggestions?
    Here's the code:
    /*These are the scrubber functions*/
    var scrubInterval;
    loader_mc.scrub_mc.onPress = function()
        clearInterval(videoInterval);
        scrubInterval = setInterval(scrubber,10);
        this.startDrag(false,0,this._y,373,this._y);
    loader_mc.scrub_mc.onRelease = loader_mc.scrub_mc.onReleaseOutside = function()
        clearInterval(scrubInterval);
        videoInterval = setInterval(videoStatus,100);
        this.stopDrag();
    function scrubber()
        ns.seek(Math.floor(loader_mc.scrub_mc._x/373 * duration));
    Any help is appreciated.
    Thanks in advance

    Thanks for the reply. I figured there is something wrong with the either the reg points or I'm not actually scripting the scrubber correctly. Sorry I'm very newbish on AS so what you recommend I do?

  • Problem Cursor disappears / Drag and Drop doesn't work

    Hey everybody,
    I have an urgent problem!
    Three butterflies are supposed to be dragged in an object.  My customized cursor is sort of a landing net to catch these butterflies.
    For the cursor I have this code:
    cursor_mc.startDrag("true");
    Mouse.hide();
    My drag and drop code is:
    cursor_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    redbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    violetbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    yellowbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    cursor_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    redbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    violetbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    yellowbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    function startMove(evt:MouseEvent):void {
       redbutterfly_mc.startDrag();
       cursor_mc.startDrag();
       violetbutterfly_mc.startDrag();
       yellowbutterfly_mc.startDrag();
    function stopMove(evt:MouseEvent):void {
       redbutterfly_mc.stopDrag();
       cursor_mc.stopDrag();
       violetbutterfly_mc.stopDrag();
       yellowbutterfly_mc.stopDrag();
    But when I'm clicking on a butterfly my cursor stops to move and stays on the position of the butterfly, which i'm dragging. After dropping it, there is no cursor at all so one doesn't know where the mouse is currently located.
    Does someone know why this doesn't work? I'm working currently with a mousefollower, because at the moment this is the only way it works..
    The mousefollower code is:
    addEventListener(Event.ENTER_FRAME, enterFrameHandler)
    function enterFrameHandler(event:Event):void {
        cursor_mc.x += cursor_mc.mouseX / 4;
        cursor_mc.y += cursor_mc.mouseY / 4;
    But now I have the problem that only the yellow butterfly moves even if I'm clicking on the red or the violet...
    Please help me!! Thank you in anticipation!

    You've solved the problem, thank you very much!
    Since it seems you know all about actionscript or at least all answers to my questions, I try my luck a further time
    If I wanted to collect the caught butterflies in a certain target, for example a flowerpot, where the butterflies can't be removed after dragged in, is this more or less the code for it? I haven't tried it yet but I'm searching the internet for something like that and maybe it is the right thing? And is in this case "myTarget" the name of the picture which is used as the target? Thank you in advance!
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        event.target.parent.addChild(event.target);
        startX = event.target.x;
        startY = event.target.y;
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
            event.target.buttonMode = false;
            event.target.x = myTarget.x;
            event.target.y = myTarget.y;
            counter++;

  • MouseEvent.CLICK Problem i think...

    I am making a game that wil be included in a school project. its a basic shoot the alien type game. My problem is that it will not respond to a mouse click at all. The weired thing is using the same exact code just changing the event to MOUSE_OVER instead of CLICK it works fine. But I want it to work on the click. Any help would be greatly appreciated. Heres my code for the game_alien class:
    package  {
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         public class game_alien extends MovieClip{
              private var health = 2;
              public function game_alien() {
                   this.addEventListener(MouseEvent.CLICK, hit); //here is the problem
              private function hit(event:MouseEvent) {
                   trace(health);
                   health--;
                   if (health == 1){
                      this.gotoAndPlay("first_hit");
                   if (health == 0){
                        this.gotoAndPlay("end");
                        parent.removeChild(this);
    and i dont know if this would help anything but here is the code for the game class which encapsulates the game_alien object:
    package  {
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         import flash.ui.Mouse;
         public class game extends MovieClip{
              var new_cursor:Cursor = new Cursor();
              var alien:game_alien = new game_alien();
              public function game() {
                   changeCursor();
                   addAlien();
              private function addAlien(){
                   addChild(alien);
              public function changeCursor(){
                   Mouse.hide();
                   stage.addChild(new_cursor);
                   new_cursor.startDrag(true);
    Also it isnt throwing any errors or message to the output box (besides my trace statement ). Its kinda like due in two days two so any response on the idea is realllyyyyy apreciated thanks

    you're welcome.
    p.s.  in the future, mark helpful/correct answers, if there are any.

Maybe you are looking for

  • Multiple Apple Boxes, One House ?

    My dad is in the living room watching a movie off the apple box, but when I tried watching it in my room it doesn't go trhough. Can one not watch movies at the same time under one network because its streaming a movie?

  • Fonts hard to read at small font sizes in browser.

    Hi! Recently i switched to Arch 64-bit and everything seems fine but the fonts at some places. This is what they look like: This is my .fonts.conf: <?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <match target="font"> <edi

  • Site Wide Design-Time?

    I've got a site that uses a lot of server-side includes, because the client has a lot of redundant info all over the place. When I edit these includes in Dreamweaver, the best way to handle it is to use my stylesheets at Design-Time (a feature I just

  • Conversion of an AIR-AP1120B from autonomous to LAP

    Does anyone know if it's possible to convert the AIR-AP1120B from autonomous to LAP?

  • Oracle linux  login

    hi i am new to oracle on linux........ i just performed the installation of oracle 10gR2 on linux 5 but now how i work on terminal...just like windows we set oracle_sid=ora, C:/ sqlplus/nolog is there something that must be set before to work on data