Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6323631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:33:20+00:00 2026-05-24T16:33:20+00:00

I have a pause screen that is being added when you click the pause

  • 0

I have a pause screen that is being added when you click the pause button inside my current game. Once this is called, the PausePanel class kicks in and adds a ‘view’ to itself to the stage (which is a single movie clip called PauseScreenView that contains all of the buttons, sliders, etc. that I need it to). In this pause panel, I’m trying to set up a custom slider so I can control the volume. Right now I’m ignoring the whole volume thing and just trying to get it to display some text in a dynamic text window on the same pause panel. Now I have everything set up and working, however, there is a problem. I can only “grab” the slider knob (called volKnob) when it is at the far ends of it’s range. And to make things worse, I can’t grab it from anywhere on the knob movieclip graphic except the left edge when it’s on the left side of its range and the right edge when it’s on the right side of its range. Also if I let go of it while not at a far edge, then I can’t grab it again at all. I’ve set up other drags before, and one is even in another place of this game. They all work fine and I can grab the object from anywhere I want within the edges of the graphic. But on this page I can’t seem to get it except for the edges. Now this is the first time I have tried setting a limit to it’s range, but if I take that bit out it still won’t let me grab it from just anywhere. Here is the PausePanel.as code:

package {
import flash.events.Event;
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
import flash.geom.Rectangle;

public class PausePanel extends MovieClip {
    public var viewPause:PauseScreenView;

    private var boundsRect:Rectangle;

    public function PausePanel():void {
        addEventListener(Event.ADDED_TO_STAGE, addedToStage);
    }

    private function addedToStage(e:Event):void {
        removeEventListener(Event.ADDED_TO_STAGE, addedToStage);

        //add the graphics
        viewPause = addChild(new PauseScreenView()) as PauseScreenView;

        //set up variables
        boundsRect = new Rectangle(60, 185, 360, 0);

        addEventListener(Event.ENTER_FRAME, onEnterFrame);

        viewPause.Knob.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    }

    private function onEnterFrame(event:Event):void {
        sliderValue = viewPause.Knob.x / 3;
        viewPause.status_txt.text = "Slider position is: " + sliderValue;
    }

    private function startDragging(event:MouseEvent):void {
        var currentDragObject:MovieClip = event.currentTarget as MovieClip;
        currentDragObject.startDrag(true, boundsRect);
            currentDragObject.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    }

    private function stopDragging(event:MouseEvent):void {
        var currentDragObject:MovieClip = event.currentTarget as MovieClip;
         currentDragObject.stopDrag();
        currentDragObject.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
    }
}

}

Is there something that anyone see’s where I missed something or set up something incorrectly? I have tried a number of different things and all of them have worked in the same messed up way. Any ideas?

UPDATED:

OK I took this code out and made it the constructor class for a blank fla with just a knob and text window. Once I took out the viewPause section of this, it works perfectly. It drags just like you think it would. The problem comes into being with the fact that the knob is a child of viewPause it seems? Is there some special trick to getting a drag to work when the drag object is a sub-object of another besides how I show it in the code (i.e. viewPause.Knob)??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:33:20+00:00Added an answer on May 24, 2026 at 4:33 pm

    This code actually works perfectly for anyone who happens to search this topic. My problem was occurring because I had a range set up that the mouse would not work so false clicks wouldn’t occur on the screen that is below this one. The range just happened to be over top of the majority of this slider object I was creating except at the edges of the sliders range. Hence my problem. So in the end it was just programer error that caused this not to function properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have created a Blackjack app that uses several methods that get called
I have a short audio clip that plays when a button is pressed. I
I have a pause button/method(not the greatest but it works). Currently, I am changing
I have a Bash shell script in which I would like to pause execution
I have a binary file that I have to parse and I'm using Python.
My application receives strings that represent objects. I have to parse the strings to
Is there a easy way to do this? Or do I have to parse
I have a class to parse a matrix that keeps the result in an
I have been trying to parse Java exceptions that appear in a log for
I have some image processing code that runs on a background thread and updates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.