ActionScript 2.0 :: Making Knob Pan Center - Only Go Left / Right Between Ranges

Jul 9, 2010

How to accomplish making the knob pan center at 60 for 60 Hz and only go left and right between the ranges of 59.95 to 60.05 in increments of 0.05? I am illustrating synchronizing between two power systems. I got the scope and and voltage wave forms down but making the knobs work the way we need is driving me nuts.

View 0 Replies


Similar Posts:


ActionScript 3.0 :: Maths - When Click On The Knob It Turns 90 Either Left Or Right Depending - Get The Angle In Whole Numbers?

Mar 11, 2011

Code:
knob_mc.addEventListener(MouseEvent.MOUSE_DOWN,turn);
stage.addEventListener(MouseEvent.MOUSE_UP,endTurn );
function turn(e:Event):void[code].....

This is the code I'm using to move a knob the challenge is when i click on the knob it turns 90 either left or right depending where i click, I'd like it to stay still until I turn the knob, and second how do I get the angle in whole numbers??

View 3 Replies

IDE :: Set Somethings X / Y To Be Its Center And Not Its Top Left

Oct 15, 2010

how do i set somethings x/y to be its center and not its top left.i know that i can do X = mc.x - mc.width/2 but i think its possible to set its default to understand that its already centered in this way, just im not sure how

View 2 Replies

ActionScript 3.0 :: Rotation Around Center With Registration In Top Left

Jun 20, 2011

I coded an entire file based on the top left registration point of my movie clip. I want it rotate it to point at the cursor, but since the registration point isn't in the middle.. its not a perfect rotation around the center of the mc. Is there anyway to rotate it around the center of the movie clip without changing the registration point?

ActionScript Code:
stage.addEventListener(Event.ENTER_FRAME, aimBall, false, 0, true);
function aimBall(event:Event):void {
ball_mc.rotation = getAngle(ball_mc.x, ball_mc.y, mouseX, mouseY) -90;
trace(ball_mc.rotation);
} function getAngle(x1:Number, y1:Number, x2:Number, y2:Number):Number {
var radians:Number = Math.atan2(y1-y2, x1-x2);
return rad2deg(radians);
} function rad2deg(rad:Number):Number {
return rad * (180/Math.PI);
}

View 9 Replies

ActionScript 3.0 :: Top-left Registration Point To Center Conversion (2D To 3D)?

Nov 16, 2010

I'm making a 3D room builder. The user places Sprites around the 2D stage and my script converts those Sprites to Papervision3D DisplayObject3D objects. I'm having problems with the 3D object positioning because Sprites have registration points at their top-left corner and 3D objects have registration points at their center. How can I make that conversion?ere's a scheme of how the 2 different coordinate systems work:

I've tried this code:
child3D.x = child2D.x;
child3D.z = child2D.y - child2D.y - child2D.y; // just to make it negative

[code]....

View 5 Replies

ActionScript 2.0 :: Move The Registration Point From Top/left To Center?

Jul 11, 2003

I start with a question: how could I change the registration point of a movie clip created or loaded at runtime? I want to move the registration point from top/left to center.

View 2 Replies

ActionScript 3.0 :: Sprite X / Y - Values Reference Top Left Corner Or Center

Jun 3, 2010

I've checked this behaviour: If I define a sprite (by programming) as:
var square:Sprite = new Sprite();
square.graphics.beginFill(16750899, 1);
square.graphics.drawRect(0, 0, width, height);
square.graphics.endFill();
return square;
When I check the position of the sprite ( square.x, square.y), they reference the TOP-LEFT CORNER.

If I create a symbol by Flash CS4 and export to Actionscript (I also associate one class which extends Sprite for doing "new()" in my code):
var square: MyClassExtendsSprite = new MyClassExtendsSprite();
When I check the position of the sprite (x, y), they reference the CENTRE of the sprite!

View 3 Replies

Actionscript :: Make A MovieClip Rotate Around It's Center Point To The Left Or Right?

Jun 27, 2011

I need to make a MovieClip rotate around it's center point to the left or right depending on mouse drag. I got some basic semblance of what i want going, but it's pretty hackish. Normally i calculate the angle and such but i only really need to use the distance the mouse travels and apply it to the movieclip and for flavor add some nice easing when you let go.

public function Main()
{
var wereld:MainScreen = new MainScreen();
addChild( wereld );

[Code]....

View 1 Replies

ActionScript 3.0 :: Way To Scale Up An Object From Its Center Even If Its Registeration Point Is At The Top Left?

Oct 3, 2009

1. Is there a way to scale up an object from its center even if its registeration point is at the top left? can that be done using TweenMax?2. can I apply the same tween on two objects at the same time? basically what I want to do is load up an image to the stage, and then tween its scale from 0 to the original size along with another movie clip behind it that would form some sort of a border for the image. and I want to scale them up from the center.

View 5 Replies

ActionScript 2.0 :: [Flash8] - Resizing - Movieclip Resize On Center, But I Want Is On Left?

Apr 26, 2007

resizing movieclip using action script. I doing a resize on the width of the moviclip. What i got is the movieclip resize on center, but i want is on left. the code i use as below:

MovieClip.prototype.resizeMe = function(w) {
var speed = 3;
this.onEnterFrame = function() {[code]......

View 2 Replies

IDE :: Change Registration Point (left Center Corner Etc) Of Object

Oct 28, 2010

When you create shape on stage and right click and chose create object you can chose Registration point for the object you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?

View 5 Replies

Professional :: Change Registration Point (left Center Corner Etc) Of Object?

Oct 28, 2010

When you create shape on stage and right click and chose create object you can chose Registration point for the object

you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?

View 1 Replies

Flex :: Changing Registration Point From Upper Left Corner To Center?

Mar 31, 2011

I want to learn how you can change the registration point for the Canvas.I want to make a zoom of this component, but the point registration in the upper left corner! How do I move to the center?

View 3 Replies

Flex :: Changing Registration Point From Upper Left Corner To Center

Mar 31, 2011

I want to learn how you can change the registration point for the Canvas. I want to make a zoom of this component, but the point registration in the upper left corner! How do I move to the center?

View 3 Replies

Flash 10 :: Change Registration Point (left Center Corner Etc) Of Object

Oct 29, 2010

When you create shape on stage and right click and chose create object you can chose Registration point for the object..you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?

View 2 Replies

ActionScript 2.0 :: Make .swf Movie (760*400) Center 9top,bottom, Left, Right) In Html Without Using Frames Or Nestedframes?

Jul 22, 2002

How can i make my .swf movie (760*400) center 9top,bottom, left, right) in HTML without using Frames or Nestedframes? (in case of old versions of netscape and IE?)does anybody now a script or HTML for this?

View 4 Replies

ActionScript 3.0 :: Making Z Scale From Center?

Jan 21, 2010

when i edit an objects z value in flash, the "scaling" is not centered, i want to emulate the same effect as center scaling x and y but using Z, how fo i do this?

View 1 Replies

ActionScript 2.0 :: Making Object Moving To Left And Right?

Jun 26, 2011

I'm newbie in Flash and action script, just start learning T__T...
onClipEvent (load) {
speed=10;
} onClipEvent (enterFrame) {
if (key.isDown(key.RIGHT)) {
_x+=speed;
} else if (key.isDown(key.LEFT)) {
_x-=speed;
} if (key.isDown(key.UP)) {
_y-=speed;
} else if (key.isDown(key.DOWN)) {
_y+=speed;
}}
Is that making the object moving to left and right?

View 3 Replies

ActionScript 2.0 :: Making Flash Chatroom With Video Without Flashcomm/media Center?

Dec 16, 2006

is there anyway to make a flash chatroom with video webcam capabilities without using flash comm / media server?

View 4 Replies

ActionScript 3.0 :: Rotation Center Is In Left Of The Image - Aren't 3D Rotation From Transform Panel

Jan 7, 2010

I have a movieclip and when I do 3D rotation from Transform panel, It rotates perfect, center is in the middle of image, and when I apply mc.rotationY, rotation center is in left of the image, aren't 3D rotation from Transform panel and mc.rotationY from AS same? what's up?

View 2 Replies

ActionScript 3.0 :: How To Rotate Circle And Use It As Volume Knob

Apr 22, 2009

I want to rotate a circle so I can use it as a volume knob. I can change the volume with a slider but not a knob.

View 1 Replies

ActionScript 2.0 :: How To Make Knob That Turns Volume

Jan 11, 2009

i want to create an mp3 player with volume ,frequency, bass, treble and speed knobs any pointers to any scripts that might help me would be great, but at the moment i am just trying to work out how to make a knob that turns.I assume i would use drag over and some kind of rotation function.

View 0 Replies

ActionScript 3.0 :: Rotate Knob On Radio Object Using Keyboard?

Jan 11, 2010

I am using Flash Cs4 actionscript 3. I want to be able to rotate a knob on a radio object left or right using the left or right arrow keys on the keyboard. I've been reading tutorials and trying different things but can't seem to get it to do what I need it to. Here is some of my code.

stage.addEventListener(KeyboardEvent.KEY_UP,rotate Up)
function rotateUp(e:KeyboardEvent):void
{
if (e.keyCode == 38)

[Code].....

View 1 Replies

ActionScript 3.0 :: Volume Knob Doesn't Follow It's Associate Track

Jun 2, 2009

I built an FLV player that scales to full-screen and on fullScreen, the control bar resizes in a non-uniform manner. The whole control bar is scaled down to 33% of original so the controller isn't barbarically huge. Then the progressBar scales in X to fill up the width now empty due to the uniform scale-down, and the elements to the right of the progressBar all move over in X to appropriate positions to distribute nicely across the width of the remaining video screen. Problem is that the volume knob that is attached by the FLVPlayback component to the volumeTrack that I've moved in X does not move with the volumeTrack. It just sits in it's original position and stays there until you mouseDown on it, then it pops over to the volume track's new position and behaves nicely.

I've tried to set volume on the fullScreen event, thinking it would pop the knob back into place over the track, but that doesn't work.... And I can't find any method of the FLVPlayback class that you can call to reevaluate the position of all of the UI elements to current, etc....

I also can't find any onClick handler for the assigned volume knob so that I could call it directly, etc. Does such a handler exist in the FLVPlayback class and I just can't see it??

View 5 Replies

ActionScript 3.0 :: Update Radio Channel Info In Text Window As Knob Turned

Jan 11, 2010

I now have radio dials on my radio which rotate when the user presses the left and right arrow keys. I now am trying to update the numbers in a display window of the radio so that as the user turns the knob the digital numbers in the radio will increase or decrease accordingly.

Here is the current code:
var gasAmount:Number=0
stage.addEventListener(KeyboardEvent.KEY_DOWN, spinPointer)
function spinPointer(ke:KeyboardEvent):void {
trace(ke.keyCode)
switch(ke.keyCode){
[Code] .....

View 2 Replies

ActionScript 3.0 :: Using Ranges In A Switch...case?

Sep 25, 2009

In other programming languages that use switch/case, I was often able to set a range. In the documentation (flash help) they do not show the syntax for this. Is it possible to do so, such as:

Code:
switch (theAnge)
{

[code].....

View 7 Replies

ActionScript 2.0 :: Possible To Use Ranges In Switch Statement?

Feb 27, 2006

Can you use ranges in a switch statement
E.g.
case 1 to 5:
case 20 to 30:
or even
case 1 or 2:

View 1 Replies

ActionScript 3.0 :: Dynamic Charts With Variable Ranges?

May 5, 2011

Basically, I already have access to a tool (not flash, no source code available) that does all these complicated calculations based on dozens of variables and generates 2 charts/graphs based on those calculations. I'm making a "light" version that will only use 2 of those variables and a set of "standard values" that will act as a lead n/conversation starter.So, I have to display 120 different charts/graphs (60 pairs of graphs) that will be calculated by selecting variables from 2 different drop downs (one has 10 selections, the other has 6).Each chart is made up of 15 different data points that will be displayed on the chart with lines connecting them, so a total of 30 data points for each "set" of variables.

Here are my options:1) plug the numbers into the tool and grab a screenshot of the charts. Since the charts are ugly, I would have to physically re-draw each of the 120 charts to look the way it needs to in order to match the rest of the application2)...and this seems like the right way to go if I can figure it out...I can export the data points from the tool as xml, I use that to build arrays within flash and then dynamically plot the points and draw the lines. The only problem I'm facing conceptually is that the range on the y axis will change so I'll need to dynamically create the horizontal range line indicators, populate the range fields based on that range and keep everything constrained within the vertical limits of the chart.

View 4 Replies

ActionScript 3.0 :: Highlight Different RANGES Of Text With Different Styles?

Feb 12, 2010

I want to highlight different RANGES of text with different styles. (for instance, make character 1-10 bold, 15-18 italic, etc..)

TextRange looks like the appropriate tool, but when I loop through, and create multiple TextRanges for each area/style, the resulting display only appears to show the last one.

Code:
for (var counter:Number=0; counter < testVtt.markUps.length; counter++)
{
var m:MarkUp=testVtt.markUps[counter];

[code].....

View 1 Replies

ActionScript 2.0 :: Number Ranges In Switch / Case

Jun 1, 2004

I think I understand how to use switch/case conditions in Actionscript for concrete values. Can the same be done with ranges? - case > 5 - or something like that? Perhaps even - case > 5 < 10 - ?

View 14 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved