Movie clip RemoveEventListener isn't working - AS3

Friends,
what seems to be a pretty straightforward code doesn't seem to work. I have a movieclip on the stage( this is on the second frame while the first one is the login screen). On this movie clip i load a textarea.
When the screen goes from 1 to 2, i setup a zoom listener on the movie clip. Once the user initiates a zoom on the movie clip, i add two move event listeners (mouse down and up) to drag the movie clip. After all is done, i restore the movie clip to it's original position. In this restore code, i remove the mouse down and up events. But i don't think the remove event listener is working as i could still drag the clip(mouse down and up events are still active).
What could be the issue ? Am i missing something here ?
Thanks

This is onZoom();
public function onZoom(event:TransformGestureEvent):void
            // When the stage throws the gesture zoom event, enlarge the stage.
            event.stopImmediatePropagation();
            scStage.scaleX *= event.scaleX;
            scStage.scaleY = scStage.scaleX;
            if ( ! scStage.hasEventListener(MouseEvent.MOUSE_DOWN) ){
                scStage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
            if ( ! scStage.hasEventListener(MouseEvent.MOUSE_UP) ){
                scStage.addEventListener(MouseEvent.MOUSE_UP, onUp);
and this is restore code - both are in the same frame;
public function onRestore(event:MouseEvent):void{
            scStage.width = mwidth;
            scStage.height = mheight;
            scStage.x = mx;
            scStage.y = my;
            scStage.removeEventListener(MouseEvent.MOUSE_DOWN, onRemove);
            scStage.removeEventListener(MouseEvent.MOUSE_UP, onRemove);
scStage is the movie clip.
however, i solved this problem in a different way as the eventlistener removal didn't work. if the component has been restored to the original position, i take appropriate action. thanks for your time.

Similar Messages

  • Basic invisible button movie clip frame actions not working, pls. help!

    Hi,
    I've got a basic little slide show player which is timeline-based, rolling through 5 images with alpha transitions, and on the topmost layer, I have 5 invisible movie clips which have actions applied to them as follows:
    on (press) {
        gotoAndPlay(21);
    This action should allow for the on click button to navigate to that specific frame, or image, but for some reason it is not working.
    Did I do something wrong? I feel like I've done this before but I'm rusty with Flash since I don't use it all the time.
    Any help is greatly appreciated!
    Thanks,
    Sean

    The invisible movie clip is something I know I've done over the years on many occasions - I'm not sure I'm understanding your alternate technique, can you explain it better? The way my movie clips are invisible is just by setting the alpha to zero in the properties for the movie clip instance (clicking on the object on stage, then setting it in properties)..
    Also, the actions are on the invisible movie clips (buttons) and not the timeline.
    Cheers,Sean

  • I-Movie: Clip-Functions don't work

    I'm working on I-Movie and i'm trying since three days to edit my videos with the functions under the menue point "Clip", but this isn't just possible. All the functions under "Clip" are inactive (shown in a light grey) and i can't use any of them.
    I've already unlocked all the clips i've imported (the format of the is .avi), i've marked them to edit them, but there seems no working solution.
    Any suggestions to solve the problem?
    Thanks

    Add video to your project
    1. Open an existing project by double-clicking it (don’t click the project’s name directly) in the Project
    Library.
    If you don’t see the Project Library, click the Project Library button
    You select an Event by clicking its name once. The Event footage appears in the Event browser to the
    right of the Event Library.
    2. In the Event Library, select an Event whose footage you want to add to your project.
    If you don’t see the Event Library, click the Event Library button, which is typically located in the lowerleft
    corner of the iMovie window.
    3. In the Event browser, select a range of video frames or an entire video clip.
    To select an entire video clip, hold down the Shift key and click the clip once, so that it’s outlined in
    yellow.
    To select a portion of a clip (called a frame range), drag across any clip while you hold down the button
    on your mouse or trackpad. Selected frames are outlined in yellow.
    4. Drag your video selection to the Project browser.
    You drag by holding down the button on your mouse or trackpad as you move the selected clip to the
    Project browser. You can drag it anywhere: to the beginning or end of the project, or between clips
    you’ve already added. A vertical green line, along with a green Add symbol, appears anywhere you
    can place the clip.
    Once video is added to the Project Browser window, it may just be the case that the Clip Menu becomes available, and everything will not be grayed out but working as you expect it to.

  • My Clipping Path isn't working? Please help...

    I am working in Photoshop CS4 on Mac. I have followed the steps below to create a clipping path:
    * Opened image that I want to add a clipping path to
    * Selected the part of the image that I wanted to clip (with the eliptical marquee tool)
    * On the Paths tab, selected "Make Work path"
    * In the pop-up box tolerance is set to 0,5pixels
    * I can now see an outline of a shape on the image
    * In the Paths tab - double clicked on the work path and saved the path as "Path 1"
    * Select the created path on the path tab and then chose "Clipping Path" from the tab dropdown
    * Left "Flatness" blank in the pop-up provided
    * The name "Path 1" now looks outlined in the paths tab
    I have tried to save the image as a JPG, PNG, TIF... RGB and CMYK... nothing seems to work. The entire image still previews.
    I turned off OpenGL and there are no layer styles applied to the image. There is only one layer in the file. I am very confused... this function used to work and now for some reason it doesn't. Are there any other settings linked to creating a clipping path that i may have changed by mistake without knowing it would affect this?

    Tiff format definetly works - i have used it in the past. I just tried EPS and the clipping path works - so thank you!
    It seems that I have been a bit stupid though... I just realised my error - to check if the clipping path was applying correctly, I have been opening the clipped image in Preview... It seems that Preview can't "see" the clipping path on a .tif and it "sees" the area outside the clipping path on an .eps as "flattened" (so i see a hard white background, when i am expecting it to be transparent). I just imported the .eps and .tif into Indesign and Illustrator and the clipping path applies fine in both cases. it seems that the real issue is between Mac and PC.... I am running Adobe on Mac and Corel Draw on PC... Corel Draw seems to have an issue with .eps and .tif files with clipping paths.
    png works in Corel Draw but transparency causes distortion for elements behind the transparent section... will keep trying :-)
    ...this is the story of my life! I hate working on PC but every now and then a client gives me a file where the artwork has been created in Corel Draw and I'm faced with these anomolies...
    Thanks for helping me to think this through logically!
    FYI on tiff format clipping paths...
    Source: http://www.espressographics.com/text/fileformats.html
    Photoshop EPS (.eps): EPS stands for Encapsulated PostScript format, which is based on the PostScript printing language. Most .eps graphics are created and edited in a draw (vector) application like Illustrator, and when you open an Illustrator vector .eps image in Photoshop, Photoshop will still convert it to pixels. As such, an Illustrator .eps doesn't have the same editable properties as a Photoshop .eps graphic so don't confuse the two. Photoshop .eps format is primarily used for creating images with clipping paths and monotone/duotones. It used to be that an image with a clipping path could only be saved as in .eps format in Photoshop. This is no longer true with later versions of Photoshop where you can save graphics with clipping paths in .tif format as well. When you create a monotone or duotone image in Photoshop, it is still best to save it in this .eps graphic file format, although .psd and .pdf options are also available.

  • The movie I bought isn't working

    :

    I  bought it on itunes. it is only letting me see the preview. The whole movie isn't visible for some reason. PLEASE HELP.

  • A movie redemption code isn't working.  what do I do?

    The code keeps showing an invalid message.

    AppleCare+ is an extended form of the AppleCare warranty extension, not available in all countries, not sure about UK.  Best solution is to take the iPhone to an Apple store genius bar and have the techs check it out and advise you.  We are all fellow users on here and cannot speak for Apple or what they will do.

  • Working with movie clip in flex

    I am using a movie clip with animation having 2 frames
    developed in flash cs3 in flex. The movie clip has mouse hover and
    mouse out animation. Now I am using the movie clip and want to make
    a click event on the clip. But it does not work at one click. I
    have to click more than once. Also When I remove that animation the
    click event goes well.
    Can I make a movie clip by flex?
    or
    How can I use that movie clip with animation developed in
    flash cs3 and also click event work well.
    Please help me.

    Actully I have two frame in movie clip(cs3). On mouse hover
    it goes to second frame and on mouse out it comes to first frame.
    Now when I am using this movie clip in flex and want to get the
    click event on that movie clip it does not work at once. If I
    remove the mouse hover and mouse out from movie clip the click
    event works. But to get those mouse hover and mouse and in over
    movie clip I had to write to many code.
    However that mouse hover and mouse out by flex over movie
    clip it takes time to get work.

  • Pause & Play Animation When i'm using movie clips- filters

    Pause & Play Animation When i am using movie clips-
    filters
    Graphic and movieclips are using for my animation
    When i Press the pause the movieclip animation not stopped.
    Any way to apply the filters on graphic
    I want to apply the filters for particular graphics or movie
    clips. with navigational button working.
    Please help me.
    Thanks
    S.Satheesh Kumar

    Audio on the timeline, especially stream, tends to play very reliably. Is this project under any NDA or can you provide a FLA to examine? Let me know if you want to private message it and I'll shoot you a message.
    What version of Flash Player are you targeting and is this AS2 or AS3?

  • Movie Clip not playing correctly (Flash CS3, AS2)

    Hey, I'm making a tutorial for a board game and there's this movie clip that mimics a piece being played. It's basically empty for about 9 frames and then the piece is on the 10th frame. On the 10th frame, I placed a stop(); script. The movie clip has no linkage and no label.
    For some reason, on a certain frame, it didn't work. It worked fine on other frames so I copy & pasted from those frames and replaced the movie clip that did not work right. Oddly enough, after I copy & pasted the movie clip, the error spread to the movie clip I copied! I tried it again and again the error spread to what ever clip I copied from. The other movie clips (same item) still functions properly. I never encountered a problem like this. Can anyone please help?

    1. you should have no code attached to objects.  assign your objects instance names (eg, mc) and use those names in your code.
    2. that code should not be in an enterframe loop. 
    if(_root.action_ryu==1){
    mc._alpha=100;  // not _Alpha
    mc.gotoAndPlay(4);
    _root.Ryu._alpha=0;
    } else {
    _root.Ryu_Attack._alpha=0;

  • Use movie clip event handler function, but not via an event

    Let's say I have the following code:
    var initObj = new Object();
    initObj.mood = "happy";
    mc = attachMovie("mcBox","instBox",100,initObj);
    mc.onPress = boxPress;
    function boxPress() {
    trace("Box mood: " + this.mood);
    Now, let's say there are times that I want to call boxPress()
    other than when the onPress event happens. In other words, I want
    to call boxPress() for a movie clip via my AS code, but not when an
    onPress event has occurred for that movie clip. Is this possible?
    Or is it possible to simulate or force an onPress event for a movie
    clip so that the handler function gets called for that movie clip?

    addEventListener only works with components in ActionScript 2
    "workingonasite" <[email protected]> wrote
    in message
    news:f1vu8r$92i$[email protected]..
    > So I am trying to get my head around event Listeners.
    When I use this
    > example
    > on a button it works fine:
    >
    > but when I add the same listener to a movie Clip on the
    stage with an
    > instance
    > name of "box", it does not work. Is there something
    basic I am missing?
    >
    >
    >
    > var buttonListener:Object = new Object();
    > buttonListener.click = function(eventObj:Object) {
    > trace("click");
    > };
    > mybutton.addEventListener("click", buttonListener);
    >

  • Loading a movie clip loses my script function

    I have an art gallery that is in three parts. The Flash movie
    used to load everything before opening, but the gallery has grown
    too large. So now I've divided it up into three sections. The first
    section loads the first set of pics with the movie. The second and
    third sections load when you click on the relevant buttons. The
    interface (root movie) has 2 movie clips per section - the
    thumbnails (all three of which load with the movie) and the large
    pics of the thumbnails. So when you click on a thumbnail the proper
    large work shows in the other movie clip. This all worked fine
    using this code in my thumbnails for the largeWorks sections:
    stop();
    large1_btn.onPress = function (){
    _root.largeWorks_mc.gotoAndStop(1);
    large2_btn.onPress = function (){
    _root.largeWorks_mc.gotoAndStop(2);
    etc...
    This code is in the thumbnail movie script. Notice it calls
    _root.largeWorks_mc
    Now when you click on See Large Works button a place holder
    movie clip (target) called largeWorksE_mc is replaced with
    largeWorks_mc.
    The button uses the code:
    loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);
    But now when I click on the thumbnails nothing happens. My
    thumbnail movie clip is no longer communicating with the loaded
    movie clip. What have I done wrong?

    I had trouble following your explanation.
    If code is disappearing, it is probably code in a MovieClip
    that a loadMovie replaces with another external movie. When using
    loadMovie, the MovieClip in it is destroyed and the timing is not
    something you can predict.

  • Cs4 flash movie clip question

    I have started this animation and I am turning rain drops into movie  clips with a small splash animation in the clip.I can just copy and  paste them so I won't have to animate each one or do programming. When I  test this with the swf file they turn out fine. But when I try to  export this into a jpeg/png,or avi the full animation in the movie clip  doesn't work.It just shows the first frame.Is there a way to make this  work since I would really like the single jgep files or avi since I need to transfer this to other programs. I thought  there was a way to do this but I cannot remember or I don't know if they  changed it with cs4 XD.

    Oh I am sorry I didn't say what I mean clearly XD. I want export it as a image jpeg sequence so I would have the many frames to import else where. But also I would like different single shots to show as previews as well. But when I try to do that the movie clips are not moving slowly in each image.
    And I keep trying to do avi's but the movie clips are still not working.

  • Unable to Remove Movie Clip

    Hello... I am an ActionScript newbie. I followed a tutorial
    from computer arts magazine, to create a portfolio using
    actionscript and xml. I linked the portfolio to several scenes in
    flash, such as contents and contact details. My problem is that
    when I placed a button "back" on the main stage of the portfolio,
    to redirect to the contents page, the list of artworks thats
    populated from xml remains on the next scene, or any other scene i
    link it to. I tried using unload movie clip, but nothing is
    working. Please Help. This is my actionscript:
    I don't if this helps, but I get this message in the output
    panel: Target not found: Target="_root.btn_projectsundefined"
    Base="_level0"

    check the flash help files. there's no better way to debug
    your flash applications than the liberal use of the trace()
    function.
    for example:

  • Embed movie clip in flex

    Hey,
    I have converted a avi file to an swf file with "MediaCoder".
    My plan was to simply embed this movie clip into my flex application, which did not work for me. :-(
    How can I embed the swf movie into flex AND play/stop the movie with buttons?
    I tested the following code, but when I click on the stop button I get the error:
    "TypeError: Error #1009: Der Zugriff auf eine Eigenschaft oder eine Methode eines null-Objektverweises ist nicht möglich."
    Obviously there is a problem with that swf file because another swf file is working...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="center" >
        <mx:Panel width="500" height="336">
        <mx:SWFLoader minHeight="300" minWidth="300" id="swfObj" source="@Embed('movie.swf')" creationComplete="init();" height="203" width="462"/>
        <mx:Button click="stop();" label="stop">
        </mx:Button>
        </mx:Panel>
        <mx:Script>
            <![CDATA[
                import flash.display.MovieClip;
                public var mc:MovieClip = new MovieClip;
                public function init():void {
                    mc = ( ( swfObj.content as MovieClip ).getChildAt(0) as Loader ).content as MovieClip;
                public function stop():void
                    mc = ( ( swfObj.content as MovieClip ).getChildAt(0) as Loader ).content as MovieClip;
                    mc.gotoAndStop(20);
            ]]>
        </mx:Script>
    </mx:Application>

    Actully I have two frame in movie clip(cs3). On mouse hover
    it goes to second frame and on mouse out it comes to first frame.
    Now when I am using this movie clip in flex and want to get the
    click event on that movie clip it does not work at once. If I
    remove the mouse hover and mouse out from movie clip the click
    event works. But to get those mouse hover and mouse and in over
    movie clip I had to write to many code.
    However that mouse hover and mouse out by flex over movie
    clip it takes time to get work.

  • How can I display a Movie clip from library on stage in AS3?

    Hi,
    I have a movie clip in my library and I would like to display it on the stage using AS3.
    do I have to define it as a variable?Do  I need to use this code:  addchild(movieclip);
    can I use the 'x' and 'y' to position it?
    What would the code look like?
    Ben.

    Great! it works  well ! thanks
    But I have another question, if I wanted to used the same movie clip but postion it at different x and y positions when a different btn is selected how could I do that?
    Would I have to make a copy of the movie clip and give it a different name?
    or is there an better way around it?
    Ben.

Maybe you are looking for