Drag function disabling button actions within movieclip

I'm building an interactive map and i've run into a problem. The map is draggable and I have a start and stop drag function running as well as an onEnterFrame function which restricts how far you can drag the map. The map is displayed inside of a masked area. On the map is many locations which when rolled over should pop up a little dialogue box with contact info. My problem is that it only works when i've disabled the drag functions. When the drag functions are running the buttons inside the map movie clip all stop working. How can i get around this?
Drag function:
// Start Dragging sequence
map_mc.onPress = function() {
    this.startDrag();
// Stop Dragging sequence
map_mc.onRelease = function() {
    this.stopDrag();
onEnterFrame = function() {
//Restricts player to stage
if(mc_map._x <= -1400) {
  mc_map._x = -1400;
//Restricts Bottom
if(mc_map._y <= -400) {
  mc_map._y = -400;
//Restricts Left
if(mc_map._x >= 50) {
  mc_map._x = 50;
//Restricts Top
if(mc_map._y >= 50) {
  mc_map._y = 50;
Sample button function:
//Distributors
santafespringsDI_btn.onRelease = function() {
distributorLabels_mc.gotoAndStop(11);
distributorLabels_mc._x = _root._xmouse + 10;
distributorLabels_mc._y = _root._xmouse - 80;
santafespringsDI_btn.onRollOver = function() {
distributorLabels_mc.gotoAndStop(11);
distributorLabels_mc._x = _root._xmouse + 10;
distributorLabels_mc._y = _root._xmouse - 80;
close_btn.onRelease = function() {
distributorLabels_mc.gotoAndStop(1);

I got it working, but i managed to break it again. I think this is why i was having difficulty with your suggestions earlier. I added a bit more to my code and broke it.
I have a movie clip full of captions that i assign to each location. the button will make the movie clip jump to a certain frame revealing the appropriate caption for the appropriate location and then on rollout go back to the first frame of the movie clip to hide it again. Adding this functionality in stopped the dragging and I'm wondering why it did and how i get around it?
The button code i added to activate the caption movie clip was this:
btn.onRollOver = function() {
    captions_mc.gotoAndStop(11);
    captions_mc._x = _root._xmouse + 10;
    captions_mc._y = _root._xmouse - 80;
btn.onRollOut = function() {
    captions_mc.gotoAndStop(1);

Similar Messages

  • Mouse Dragging Function Disable Help plz!

    Anyone know how to disable the Dragging functions of the Mouse? I am attempting to Play World of Warcraft and it extremly difficult to move my Charcter around with the mouse dragging function on .....Please HELP
    Also I am using a Gamer Mouse not a Apple mouse . I cant be the only one who finds this annoying lolz

    Not sure, but you might want to take a look at SteerMouse which lets you configure your mouse in various ways.
    Other possibilities:
    ControllerMate
    USB Overdrive

  • Disable Job Action within Droplet

    I made a droplet in Compressor 4 that allows me to easily transcode HDSLR footage to ProRes for editing in FCP7. Is there a way to disable the job action script that launches QuickTime X after each video clip finishes transcoding? I can't see the checkbox anywhere in the app?

    Weird? I just created a new Droplet and that job action doesn't show up anymore. Not sure how I initially set that or if it was just an initial bug

  • Forms - Button Actions not functioning properly

    Created form in Adobe XI Pro  assigning actions to buttons - when tested actions work properly - when form is emailed actions no longer function properly for the receiver - what is the remedy?

    I had assigned a "file save" followed by "print" action ... in Adobe Reader initially it gave a message that only a blank form could be printed ... it appers it may have been connected to "required" fields ... I removed all "required" fields and removed the "save" action ... now I get the "click sign to fill in fields" message which if cancelled proceeds to the print process ...
    I have removed security from the form beyond locking the fields but would certainly like to secure it from any changes but am unsure if the security may be causing an issue preventing the proper function of the actions ...
    I initially wanted the button to offer a save option which could be used or cancelled followed by the print option ... which functioned properly in Adobe XI but does not function in Reader

  • Start Drag Function with Movieclip Touch Count

    Hello,
    I have two movie clips
    "scrub" & "soap"
    i will use start drag function for the scrub  & top of the soap movie clip there 15 "dots"  of movie clips
    when scrub connect to dots it should store the value i.e +5. There is time limit 10 sec

    that won't work.  if you want to check for a simultaneous hit of circle with dot1,dot2 and dot3, use:
    if(_root.circle.hitTest(_root.dot1)&&_root.circle.hitTest(_root.dot2)&&_root.circle.hitTes t(_root.dot3)){
    also, that "+5" probably isn't going to do what you want.
    and you probably don't want to repeatedly do anything while that hittest remains positive.  you probably only want to do something when it first turns positive.
    but first things first.  you should remove all code from objects and use timeline code.  for help with that, what's the relationship (if any) between circle and scrub?  and is soap related to this discussion?

  • Buttons actioning in different movie clips?

    So ive set up some buttons into a movie clip, but i want to get them performing actions in a movie clip that is within another clip.
    For example, the code below is what I have attached to one of my buttons. The Movieclip 2photosMC2 is inside a DIFFERENT movie clip to the ones where the buttons are stored. How can I script so that the button actions activate the correct clip?
    on(release){
        photosMC.gotoAndPlay("img 02");
    With the code above, photosMC is the movie clip i want to play and img 02 is within this. The button with this code in is in a different movie clip to the one in which photosMC is held
    Any ideas?
    Many Thanks
    Dave

    If you get away from attaching code to buttons you might find it easier to manage that targeting you will need to do.  If you assign instance names to your buttons and movieclips, then you can have your code in the main timeline and assign the interaction to the objects from there.  As an example, le's say you have a button named "gtn" inside a movieclip named "btnHolder" that sits on the main timeline.  And you want to have that button tell a movieclip named "mc" that sits inside another movieclip named "mcHolder" that is also on the main timeline.  Then in the main timeline you could use...
    btnHolder.btn.onRelease = function(){
         mcHolder.mc.gotoAndPlay("img02");
    To do it the way you want would require using  _root or _parent targets, which is usually better to avoid...
    on(release){
         _root.mcHolder.mc.gotoAndPlay("img 02");
    or maybe...
    on(release){
         _parent.mcHolder.mc.gotoAndPlay("img 02");

  • How to disable Buttons based on condition.

    Hi
    Need your help to disable button based on condition.
    Please refer the application:
    http://apex.oracle.com/pls/otn/f?p=34797:5:110582943383419::NO:::
    login credentials:
    workspace: vsanthanam
    user: vijay
    pswd: apex_demo
    In the above application, i have 2 buttons in page 5, (Report1 and Report2)
    Where i have to disable button based on the following conditon:
    i) USER whoever has Admin value 'Y' in my table can access the button.
    for this i've written a Button Condition : Type (EXISTS)
    select 1 from apex_extra_values where rtrim(lower(empname)) like decode((select Admin from apex_extra_values
    where rtrim(lower(empname))=rtrim(lower(V('APP_USER')))),'Y',rtrim(lower(V('APP_USER'))))
    note: i have empname same as my APEx user name. with Admin access 'Y'.
    By using this code i can able to hide the button for users who has no Admin access.
    But my requirement is : i have to show the button even if the user is not Admin, but to grey out (disable the button - no action)
    I tried using javascript function:
    function disableButton(pThis)
    pThis.disabled=true;
    But either of this (exists condtion or JAvascript function) works in my case and not both.
    Any pointer on this would be highlt appreciated.
    Thanks
    Vijay

    Couple of things:
    1. I would never use v('APP_ITEM') but :APP_ITEM - it is faster and there is no need to use this function within an application
    2. The way you are doing this check is not the best approach. You should create an authorization schema and run this once per session. Whatever this authorization is returning as a result you can check using the following Function returning boolean:
    IF apex_util.public_check_authorization ('MY_AUTH') THEN RETURN TRUE; ELSE RETURN FALSE; END IF;
    See this example on authorization issues:
    http://apex.oracle.com/pls/otn/f?p=31517:148
    3. As far as disabling a button is concerned I think I explained the options. I also have an example on that here:
    http://apex.oracle.com/pls/otn/f?p=31517:143
    whereby it is not disabling but hiding a button.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • MovieClip buttons inside a MovieClip button inside another MovieClip button

    I am trying to make a Portfolio of my study abroad experience and can get something right about the movie clip buttons inside each other. I have a button to click on titled "travel" and a window shows up with more movieclip buttons to organize different locations of pictures. I can click on the button to have to slide of pictures but nothing happens. I have the "turnOffAllButtons"  coding and  also have the coding for stay clicked, but I can't get the 3rd set to show up. what am i not doing?
    I don't have any errors or output comments showing up

    I have it working now. what I did, I make a slideshow setup (gotoAndStop(1);) in a specific frame and the code I put in for the next, didnt work.
    this is was I have now, without the "turnOffAllButtons" coding:
    Main Button (actions Layer):
    stop();
    travelButton_mc.buttonMode=true;
    travelButton_mc.addEventListener(MouseEvent.ROLL_OVER, colorizetravelButton);
    function colorizetravelButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      travelButton_mc.gotoAndPlay(2);
    travelButton_mc.addEventListener(MouseEvent.ROLL_OUT, decolorizetravelButton);
    function decolorizetravelButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      travelButton_mc.gotoAndPlay(21);
    travelButton_mc.addEventListener(MouseEvent.CLICK, loadtravelLocations);
    function loadtravelLocations(givenEvent:MouseEvent){
      travelButton_mc.gotoAndStop(50);
      travelLocations_mc.gotoAndPlay(1);
    Inside the travelLocations_mc I have currently one button to show a slide of pictures, this is the second layer of buttoncode:
    stop();
    scotlandButton_mc.buttonMode=true;
    scotlandButton_mc.addEventListener(MouseEvent.ROLL_OVER, colorizescotlandButton);
    function colorizescotlandButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      scotlandButton_mc.gotoAndPlay(2);
    scotlandButton_mc.addEventListener(MouseEvent.ROLL_OUT, decolorizescotlandButton);
    function decolorizescotlandButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      scotlandButton_mc.gotoAndPlay(21);
    scotlandButton_mc.addEventListener(MouseEvent.CLICK, loadscotlandInfoPage);
    function loadscotlandInfoPage(givenEvent:MouseEvent){
      scotlandButton_mc.gotoAndStop(50);
      scotlandInfoPage_mc.gotoAndPlay(1);
    I turned the alpha up so you can see the mc that loads
    I currently have a keyframe at 60 with a code of stop(); so the travelLocations_mc will still
    does this make sense?

  • Simple Button Action Help

    Hi
    I am new to flash and having a bit of trouble. All I would
    like to do is be able to create a button and have that button
    navigate to a frame.
    What I am doing now is:
    Insert - New Symbol - Button and name the button (ex: about)
    Go through the up/over/down/hit steps and return to scene 1
    I then drag the about button onto the stage
    I give the about button the instance name of about_btn
    In the action layer, I enter the following code:
    stop();
    _root.about_btn.onRelease = function(){
    gotoAndStop("about");
    "about" being the keyframe I would like to go to
    When I test the button, I get error 1120: "Access of
    undefined property onrelease".
    I am working on adobe flash cs3 on a pc. I know this is a
    very simple issue and any help would be greatly appreciated.
    Thank you.

    quote:
    Originally posted by:
    db11
    When I test the button, I get error 1120: "Access of
    undefined property onrelease".
    AS3 is case sensitive. You must have mistyped onrelease
    instead of onRelease

  • Button actions only work the first time used then nothing?

    This is what I have...
    I Have 2 buttons in MC named mcMovieTrans the AS for these buttons are in the MC's timeline, the code is:
    stop();
    function playLifeboy(event:MouseEvent):void
    gotoAndStop(3);
    function playKrave(event:MouseEvent):void
    gotoAndStop(2);
    lifeboy_btn.addEventListener(MouseEvent.CLICK, playLifeboy);
    krave_btn.addEventListener(MouseEvent.CLICK, playKrave);
    when the buttons are activated they go to there corresponding frames and Stop. As an example of what happens next I'll show you frame 3 which plays MC mcKraveMovie:
    Frame 45 has a flv. movie on it that plays at this frame. The AS for this timeline on Frame 45 is:
    stop();
    function playReturn(event:MouseEvent):void
    gotoAndPlay(46);
    return_btn.addEventListener(MouseEvent.CLICK, playReturn);
    The AS for the timeline on Frame 90 is:
    MovieClip(parent).gotoAndStop(1);
    This is where the problem occurs because when this action takes place and it returns to the parent MC (mcMovieTrans) The buttons actions dont work anymore.
    And I get this error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at capQinc_fla::mcMovieTrans_89/frame1()[capQinc_fla.mcMovieTrans_89::frame1:15]
    at flash.display::MovieClip/gotoAndStop()
    at capQinc_fla::mcKraveMovie_97/frame90()[capQinc_fla.mcKraveMovie_97::frame90:1]
    Thanks

    Thanks,
    I replaced all the button symbols that where in tweens on the MC mcKraveMovie with static art. But I still Get this error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at capQinc_fla::mcMovieTrans_89/frame1()[capQinc_fla.mcMovieTrans_89::frame1:15]
    at flash.display::MovieClip/gotoAndStop()
    at capQinc_fla::mcKraveMovie_97/frame90()[capQinc_fla.mcKraveMovie_97::frame90:1]
    This is the timeline for the (Parent) MC mcMovieTrans:
    If that helps at all, the only place where the buttons are (and there actions) are in Frame 1 of this Timeline
    Thanks

  • How to intercept the InCopy 'Save' button action?

    Hi,
    I have an InCopy plug-in that can successfully intercept ‘Save’ actions from the File->Save menu (using an Action Filter).
    But in InCopy there is also a Command Bar that contains a ‘Save’ button. The problem is that I cannot work out how to intercept this button action from within the plug-in code.
    I have tried ‘Spy’ and tracing events and so far there does not appear to be any clue to what I should be intercepting to achieve this.
    (the button action does not appear to trigger a FileSave action... which is what I was hoping it would do).

    Thanks for the reply, I am beginning to think that I need to do something similar.
    Did you disable the button via code?
    I know that the class id (boss) for this button is kSaveButtonBoss.
    Regards
    Malcolm

  • One Function, multiple buttons

    I am new to AS3 and AS in general.  I know enough that you have to add event listener and create a function to handle when a button is clicked. If I have 4 buttons that I want links to 4 different pages, do I have to have 4 functions?  One for each button?  Or is there a way to use one function and somehow catch a value that determines which button was clicked and then open the corresponding URL?
    I know this has to be simple, I just don't know the answer.  Thanks for the help!

    You can use 1 function to handle all 4 button's clicks. See the example code I provided. To make the code work just drag the AS3 button component onto your movie and delete it from the stage; this will add the Button to the FLA library and make it accessible for use in code. I also attached a FLA of this example to this post.
    Let me know if you have any trouble.
    Good luck.
    Sean
    import fl.controls.Button;
    import flash.events.MouseEvent;
    var _btOne:Button = new Button();
    var _btTwo:Button = new Button();
    var _btThree:Button = new Button();
    var _btFour:Button = new Button();
    _btOne.y = 0;
    _btTwo.y = 50;
    _btThree.y = 100;
    _btFour.y = 150;
    _btOne.label = "One";
    _btTwo.label = "Two";
    _btThree.label = "Three";
    _btFour.label = "Four";
    _btOne.addEventListener(MouseEvent.CLICK, btnClickHandler);
    _btTwo.addEventListener(MouseEvent.CLICK, btnClickHandler);
    _btThree.addEventListener(MouseEvent.CLICK, btnClickHandler);
    _btFour.addEventListener(MouseEvent.CLICK, btnClickHandler);
    addChild(_btOne);
    addChild(_btTwo);
    addChild(_btThree);
    addChild(_btFour);
    function btnClickHandler(event:MouseEvent):void
         switch(event.target)
              case _btOne:
                   // insert code here for _btOne action
              break;
              case _btTwo:
                   // insert code here for _btTwo action
              break;
              case _btThree:
                   // insert code here for _btThree action
              break;
              case _btFour:
                   // insert code here for _btFour action
              break;

  • Disabled button does not look disabled

    In a simple FX app I created a button and set the disable property to true, for exampledeleteButton.disable = true The problem is that when I run the app the button does not look disabled. The only way I can tell if the button is enabled or disabled is by mousing over it: if I mouse over a disabled button nothing happens, if I mouse over an enabled button it flashes blue.
    Is this a bug either FX or Nimbus, or am I doing something wrong?
    Cheers, Eric

    I've found the same problem and a "bugy way"
    if in a Custom node:
    var bts: Button[];
    function setControl(b: Boolean) {
            for (bt in bts) {
                bt.disable = not b;
    postinit {
            Timeline {
                keyFrames: KeyFrame {
                    time: .2s
                    action: function(): Void {setControl(false)}
            }.playFromStart();
    public override function create(): Node {
            insert Button {
                //disable: bind not control
                text: "View"
                action: function(): Void {
                    onView(boxNumber);
            } into bts;
            insert Button {
                //disable: bind not control
                text: "Print"
                action: function(): Void {
                    onPrint(boxNumber);
            } into bts;
                            VBox {
                                layoutInfo: LayoutInfo {
                                    width: 80
                                spacing: 5
                                content: [
                                    bts
    ...Afterall it put an shinny effect on your screen, thank's javafx.control API ;-)

  • Is there a way to program quick keys or actions within a program?

    Specifically, Photoshop Elements 6. Since I HAD to buy the new PE6, I am learning the ins and outs and rather like it. However, it is lacking a really crucial quality that PS7 had.
    I scan 100s of images every sitting and I have to pull down the File, Import and finally scanner name to open my scanner. In PS7 I was able to program an F key to perform that function. I know it sound trivial but it drags down my streamlined job.
    So... I already found out that there's no way to do it within PE6 - but is there some Utility or Mac trick that can record an action of series of actions within a program?
    Thanks!!
    Mr. Kowchevski (The best Mathlete in the school)

    I have been using ControllerMate (http://www.orderedbytes.com) with great success. It can be used to customize functions of keyboard, mouse and trackball for specific user interactions with any applications. It is highly reliable and programmable particularly useful for unsupported input peripherals. Programming is achieved through it's user friendly graphical interface rather than through specific language and the effects can be tested in realtime. Though some boolean/logical functions for programming might seem intimidating to new users, the learning curve is not too steep.
    Download trial version from above website and try it out with your application before purchase (affordable price of USD 15). I bought it for my new Logitech optical/cordless trackball because driver from Logitech prevents many applications from running properly. See it as long term investment as it support any application and any input peripheral with good programmability.

  • Cant duplicate action or movieclips for my scrollbar

    hi
    i have some script to scroll my content in movieclip
    i use this tutorial :
    there are two movieclip : content_mc & mask_mc
    and this is my script :
    var rect:Rectangle;
    var scrollerMinY:Number = scrollbar_mc.scroller_mc.y;
    var contentMaxY:Number = content_mc.y;
    var padding:Number = 40;
    scrollbar_mc.scroller_mc.buttonMode = true;
    scrollbar_mc.scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
    function dragIt(e:MouseEvent):void {
    rect = new Rectangle(4, 3, 0, 309);
    scrollbar_mc.scroller_mc.startDrag(false, rect);
    stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    scrollbar_mc.scroller_mc.addEventListener(Event.ENTER_FRAME, scrollIt);
    function dropIt(e:MouseEvent):void {
    scrollbar_mc.scroller_mc.stopDrag();
            scrollbar_mc.scroller_mc.removeEventListener(Event.ENTER_FRAME, scrollIt);
    function scrollIt(e:Event):void {
    var scrollerRange:Number = rect.height;
    var contentRange:Number = content_mc.height - mask_mc.height + padding;
    var percentage:Number = (scrollbar_mc.scroller_mc.y - scrollerMinY) / scrollerRange;
    var targetY:Number = contentMaxY - percentage * contentRange;
    content_mc.y = targetY;
    everything works well ...
    but now i want to use this script in another frame with another Movieclips ( content )
    i set another instance name for my content movie clip for example : newcontent_mc
    copy all actions , scrollbar movieclip and mask_mc in the same
    and i replace content_mc with newcontent_mc in my script !!
    i get no error in compiler when test it but the content not scrollable any more !!
    i try to change instance name of mask_mc and scrollbar_mc and scroller_mc and change it in script too !!
    but not success at all
    in output i get this error when test the movie :
    TypeError: Error #1010: A term is undefined and has no properties.
        at RAHAPharmOrgin_fla::ampouleproducts_49/frame1()
    whats my mistake ??  what can i must do to use scrollbar for my various movieclip contents in my project ??

    change your code to:
    // put this on the first keyframe that contains content_mc
    var target_mc:MovieClip=content_mc;
    put this on the first keyframe that contains newcontent_mc
    target_mc=newcontent_mc;
    // put this on the first keyframe that contains your scroller
    var rect:Rectangle;
    var scrollerMinY:Number = scrollbar_mc.scroller_mc.y;
    var contentMaxY:Number = content_mc.y;
    var padding:Number = 40;
    scrollbar_mc.scroller_mc.buttonMode = true;
    scrollbar_mc.scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
    function dragIt(e:MouseEvent):void {
    rect = new Rectangle(4, 3, 0, 309);
    scrollbar_mc.scroller_mc.startDrag(false, rect);
    stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    scrollbar_mc.scroller_mc.addEventListener(Event.ENTER_FRAME, scrollIt);
    function dropIt(e:MouseEvent):void {
    scrollbar_mc.scroller_mc.stopDrag();
            scrollbar_mc.scroller_mc.removeEventListener(Event.ENTER_FRAME, scrollIt);
    function scrollIt(e:Event):void {
    var scrollerRange:Number = rect.height;
    var contentRange:Number = content_mc.height - mask_mc.height + padding;
    var percentage:Number = (scrollbar_mc.scroller_mc.y - scrollerMinY) / scrollerRange;
    var targetY:Number = contentMaxY - percentage * contentRange;
    target_mc.y = targetY;

Maybe you are looking for

  • Using Satellite LP500-14L as a display for PS3

    Hello, dear administration and all users ; ) I am really glad to join this forum and hoping to get some helpful experience with it : ) So.. the question is in subject.. I am just curious about it .. With eyes of average user it seems to be possible,

  • How do I keep my photos on itunes but not on my iphone 5?

    the photos and video are using a lot of space but I want to keep them on my itunes and not delete them altogether but rather delete them just from my iphone itself. please help

  • Canon FS10 and importing into FCE

    I have a Canon FS10 and want to import the footage but can't figure out which Easy Setup setting to use. I can import in iMovie 08 easily, but do not want to go through the hassle of two programs. Has anyone used any of the Canon FS line with FCE? Pl

  • Financial Reporting alernate row color display

    Is it possible in financial reporting to display the rows alternately in different colors. this improves the report readability and report looks nice.

  • Formatting Based on Hierarchy level (Dynamically)

    Hi Every one, I came across a requirement like as show below. Where ever the Hierarchy level is 2 in the rows then the entire columns should be colored as yellow...The rows should vary dynamically but the columns are static Please help me to reach th