moving an object vertically using a horizontal slider

So, I was struggling with this for hours.  I have a button, a slider (yellow triangle) that moves horizontally within a range.  At the top of the slide is a vertical meter which should move up/down based on the horizontal movement of the cursor, i.e. If the cursor moves to the left, the counter should be; If the cursor moves to the right, the meter should fall.  Both objects start at the center of their axis, as shown in the provided image.

image.jpg

This is what I have so far for the hidden counter display correctly and restrict the cursor to the range of the horizontal axis.  I can't figure out the rest to the counter to move accordingly.  Anyone out there for whom it is really easy, please help me through this; talk me through your logic about how to make this work.  Thank you!

FURTHERMORE, THIS IS ACTIONSCRIPT 2

import flash.geom.Rectangle;

Stop();

var varMaskRect:Rectangle;
var varMeterContainer:MovieClip;
var varMeterBar:MovieClip;
var varMeterMove:String;

createScrollRect = function (): Void
{
var nWidth:Number = mc_MeterContainer.mc_MeterBar._width;
var nHeight:Number = mc_MeterContainer._height;

varMaskRect = new Rectangle (0, 0, nWidth, nHeight);
mc_MeterContainer.scrollRect = varMaskRect;

varMeterBar = mc_MeterContainer.mc_MeterBar;
}

createScrollRect();

var varScrollLeftLim:Number = 18.0;
var varScrollRightLim:Number = 153,9;
var varScrollTopLim:Number = 213.25.
var varScrollBottomLim:Number = 213.25.

I need some help here...

scrollContent = function (): Void
{
I need some help here...
}

mc_Slider.onPress = function (): Void
{
startDrag (mc_Slider, false, varScrollLeftLim, varScrollTopLim, varScrollRightLim, varScrollBottomLim);
mc_Slider.OnMouseMove = scrollContent;
}

mc_Slider.onRelease = mc_Slider.onReleaseOutside = function (): Void
{
mc_Slider.stopDrag ();
mc_Slider.OnMouseMove = null;
}

Oops, I mixed as3 in there:

1 assign your blue rect an instance name, for example blue_mc.

2. ensure that its reg is in its lower part

3. make sure that your not adjusted rectangle extends to the top of the meter.  That is to say, on stage, but to the max.

4. copy and paste the following text instead of the code that you have demonstrated

change nothing below.

paramF(blue_mc,varScrollLeftLim,0,varScrollRightLim,100);
scrollContent();

scrollContent = function (): Void {}
blue_mc._yscale = blue_mc.m * mc_Slider._x + blue_mc.b;
}

mc_Slider.onPress = function (): Void {}
startDrag (mc_Slider, false, varScrollLeftLim, varScrollTopLim, varScrollRightLim, varScrollBottomLim);
mc_Slider.OnMouseMove = scrollContent;
}

mc_Slider.onRelease = mc_Slider.onReleaseOutside = function (): Void {}
mc_Slider.stopDrag ();
mc_Slider.OnMouseMove = null;
}

function paramF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):void {}
MC.m =(Y1-Y2) /(x1-x2);
MC.b = Y1 - mc.m * x 1;
}

Tags: Adobe Animate

Similar Questions

  • How to create an Interactive Moving experience or object which reacts to the slider of the Viewer?

    Hello

    I started to create a site in muse and I try to create an object that will react to the slider of the Viewer.

    I have a fix Center, whole and other image that had to move with the movement of the cursor as in this tutorial: create a moving background/interactive object that reacts to the slider of the viewer

    I want to do of muse and do not know how to proceed,

    Thank you

    Hello

    It has no native function in Muse to achieve this. If you can get the code for this, you can add it to your site by using the function insert the HTML code.

    Kind regards

    Aish

  • My monitor's display windows, word, etc. vertically and not horizontally

    My monitor's display windows, word, etc. vertically and not horizontally - how to fix?  I have the screen tilted on its side to use it right now.

    Press the CTRL or Alt + key staggered with the arrow keys to rotate your screen. It is a function of your graphics card. You can also right click power on a space empty on your desktop and in context to the rotation menu look, Orientation, landscape, or something similar.

    Kind regards

  • display flipped vertical rather than horizontal style. How to solve this problem?

    My monitor turned vertical rather than horizontal style. Don't remember the solution to change... Help, please.

    Press Ctrl & Alt keys and use the arrows to rotate back.
     

    According to the graphics card on your computer, these can be alternatives.
     

    Right click on the desktop | Graphics options | Rotation.
     

    Right click on the desktop | Screen resolution | Orientation.
     
     
     

     
  • the orientation desktop icon - is there a way to keep my icons in a vertical rather than horizontal?

    I want to keep the icons just above the taskbar in an upright position without them returning to the horizontal position, they are when I first start my laptop.  Is there a way to keep my icons in a vertical rather than horizontal?

    Hello

    1. are you talking about the desktop icons?

    If you mean the desktop icons, you can drag the icons and place it wherever you want on the screen.

    If you are referring to some other icons, then I suggest you to give us more information about the issue so that we can better help you.

    It will be useful.

  • My screen vertically and not horizontally. How can I change this back?

    OT: Screen display.

    My child has touched something on my computer and now my screen vertically and not horizontally. How can I change this back?

    Wednesday, February 11, 2015 14:23 + 0000, anniemontcalm wrote:

    My child has touched something on my computer and now my screen vertically and not horizontally. How can I change this back?

    The ability to rotate the screen image is a characteristic of your video
    card, to help work with instructors who turn to the portrait
    orientation. Certainly he accidentally pressed Ctrl-Alt, and
    an arrow key.

    Rotate using these keys.

  • Find a position of objects on a timeline of slide master when running.

    Hello

    It is more a question to people of the standard user as3 developer. I want to be able to find the position in frames of an object over a montage of slides during execution.

    So say at run time, the position of an object named "textHead" was to frame of 70. I could spend this post to a variable so that I can display the position in a text caption using a variable.

    The text of the legend would be only at the beginning of the slide, so the process would need to scan the slide of hole and recover the image position of the object on the first image.

    Anyone with ideas?

    Hi all

    Thanks for your help. I figured this out by using a totally different process.

    I created a button that sets the SPF 10 (it is so management positions are easy to calculate)

    I loaded the team to import the button and name it Slide ("whatever"). 1. 2. 3. or what dictates the course of events.

    Then on each button click the .swf will be pushed the name in a table and on each click a variable working position of the data in table

    shoot the next position in the queue. All my guys need to know is to name the button as shown above.

    Thanks for your help.

  • Horizontal slider

    I can't understand for the life of me how to operate the horizontal slider. I can make a list of data vertically, and I can do a repetitive vertical element with the vertical slider but no luck with the horizontal.

    Hey Colesmack,

    Understand and get the vertical datalist + scrollbar wired up is the first step, then you are on the right track.

    The following steps, you should get what you want:

    (1) draw a rectangle on the artboard.

    (2) select the rectangle, and then in the HUD, choose "convert work to the component... ", and then select Datalist.

    (3) notice of the yellow warning parts are missing (undefined)

    (4) click the button parts change

    (5) select the rectangle, and choose "convert work in component part..." and select the repeated item "

    (6) you should now see a vertical datalist.

    (7) in the Panel properties (lower right corner), click the "Layout" section to expand it.

    (8) here you can choose vertical, horizontal, or tile.  Select Horizontal.

    (9) so now you see what a rectangle and a few funny selection limits.

    (10) slide the right to manage most of the selection to the right.  When you release, you will see that the datalist items are now aligned horizontally.

    (11) drag a HorizontalScrollbar of 'Wired Components' Panel to the artboard.

    (12) run your project.

    You should now have a scrolling, horizontal list.

    Feel free to customize the scrolling/datalist to something more interesting!

    C, let me know if it works for you, and if that's what you're looking for.

    Tara

  • How to select a cell in a multicolumn list box and use the horizontal scrollbar on th

    An event structure, how to select a cell in a multicolumn list box and use the horizontal scrollbar on the front panel at the same time.  I can select a cell in the multicolumn in a structure of the event, but I can't move the scroll bar on the front panel when the program is running.

    I guess that you are referring to the scroll bar in the control multi-column listbox. What does your code when you select a cell? Can you please your postal code so that we can see the behavior you describe? It is possible that you are blocked the structure of the event, as in performing an operation long in case the treatment cell selection. In this case, the structure of the event must wait until the event ends before being able to respond to the next event. You can configure the event to not lock the front panel until the event ends.

  • Screen was rotated so that it is vertical instead of horizontal, how do I switch back?

    My screen has rotated 90 degrees to the right.  Now, it is vertical instead of horizontal.  I can't find any way to remedy this.

    * original title - my cat walked on my keyboard and made something of my screen in rotation.  Now my screen is vertical instead of horizontal.  How can I fix it.*

    Hello

    Try to press Ctrl + Alt + up ARROW, or try Ctrl + Alt + and a different key to the arrow.

    If this does not work: right-click on empty office rotation - graphics options.

  • Laptop HP G61 page is vertical instead of horizontal

    My daughter was on my laptop and asked why the screen is now sideways!

    The screen vertically and not horizontally.

    Can someone help me fix it please.

    This may not work with all PCs but now try press CTRL, ALT AND arrow pointing UPWARDS at the same time and wait a few seconds. On some PC the CTRL-ALT-RIGHT to reactivate the screen video sideway. Press and hold these three keys CTRL - ALT-(and a direction of the ARROW) the screen will turn accordingly.

  • When I try to use the impromptu slide show I get the message "video support is disabled" how to activate it?

    When I try to use the impromptu slide show I get the message "video support is disabled" how to activate it?

    It is a "Bug" in the software, waiting for a fix.

    It can be corrected temporarily by open images in the slideshow beforehand module and run the slide show IN THE module.

    When you return to the library grid view, the impromptu slideshow (Ctrl + Enter) will work.

  • Does anyone know html or css when I drag my magic mouse to the right there is my low site scroll vertically and when I slide to the left makes scrolling upward?

    Does anyone know html or css when I drag my magic mouse to the right there is my low site scroll vertically and when I slide to the left makes scrolling upward?

    As this Web site: our wedding

    Please check the options available here:

    http://resources.Muse.Adobe.com/search?q=swipe

    Thank you

    Sanjit

  • Some time ago I found a copy of Photoshop 5.5 (APPLICATION and TRAINING) of the CD in the trash. I'm finally moving around trying to use it, but I don't have a serial number. I have the CD original, copies illegal not - how can I get the serial numbers

    Some time ago I found a copy of Photoshop 5.5 (APPLICATION and TRAINING) of the CD in the trash. I'm finally moving around trying to use it, but I don't have a serial number. I have the CD original, copies illegal not - how can I get the serial numbers to use to get this program to work?

    Sorry to say that you are out of luck.

    Serial numbers came on the cd case. If they aren't there, you have no way to use the program except as a 30 day trial. Adobe CS5 licenses no longer sells.

    Gene

  • If I buy the plan $1.99 / month, I will be able to convert PDF files to use in PowerPoint slides?

    If I buy the plan $1.99 / month, I will be able to convert PDF files to use in PowerPoint slides?

    Hi jeannedutel,

    The service you are referring, ExportPDF, does not allow you to convert PDF files to PowerPoint. However, Adobe PDF Pack only.

    Best,

    Sara

Maybe you are looking for