ActionScript 2.0 :: Math - Give The Slider An Exponential Scale Instead Of A Linear One?

Oct 11, 2005

I've built a slider which also contains an input textfield. the slider can be dragged and it's value will be updated in the textfield. a user can also enter a value in the textfield which will then be reflected in the slider. All is fine thusfar. However, I'd like to figure out how to give the slider an exponential scale instead of a linear one. Say the slider has a minimum value of 0 and a max of 100. When the slider is dragged halfway then using a linear scale it's value would ofcourse be 0.5 * 100 = 50. To calculate the value for the exponential scale I use

[Code]...

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Flash Loading External Swfs In A Linear&non-linear Way

May 16, 2010

I'm working on a project and the deadline is near but I'm stuck at making my video presentation work. So here's the problem: it should be played linearly and non-linearly. Because the video files are long, i keep them in 9 seperate swfs. If you don't press any buttons, the presentation runs smoothly, but the problems start when you try to jump forward/backward to another part. Here's my code so far (I don't have much experience with as3, so it's mostly based on tutorials):

Code:
var clips:Array = ["swf/btn1.swf", "swf/btn2.swf", "swf/btn3.swf", "swf/btn4.swf", "swf/btn5.swf", "swf/btn6.swf", "swf/btn7.swf", "swf/btn8.swf", "swf/btn9.swf"];
var index:int = 1;

[Code]....

When I click on a button, it plays the same swf over and over... but i want to keep it in order (such as in the array). It used to work, but I had problems with sound and must've messed something up.

View 1 Replies

ActionScript 3.0 :: Scale Inverse To Slider Position?

Nov 15, 2011

I have a var that captures a slider position like this:

Code:
var sliderPosition = Math.round((thumb.y-bounds.top)/(bounds.right-bounds.top)*100);

which outputs a number between 0 and 100 starting on 0. I need to scale an mc from 1 at sliderPosition =0 to .42 at sliderPosition = 100.

View 1 Replies

Flash :: Reverse Sound Volume Math For Volume Slider?

Feb 1, 2010

I'm building a video player and am kinda stuck at the volume slider part. It's a YouTube style vertical slider, meaning if the slider is in the top position volume should be 100% and if the slider is dragged to the bottom position sound should be 0. Currently it's doing the opposite of what I want :(

Dragging the slider down will make the sound louder, while dragging up lowers it.

Here is my code below dealing with the volume slider.

[Code]....

The (-4) is an offset value so when you drag it all the way to turn it off, it's 0 and not 4. I need to reverse this somehow, so the traces above will swap... going down will make userVolume = 4 and going up will make it 30.

View 4 Replies

ActionScript 3.0 :: Maths: Exponential Value Via Loop?

Dec 27, 2010

To create a sort of thick-pixel gradient shadow, I've got a simple loop which creates a new 200x5 pixel Shape (rectangle) with each iteration, assigning an alpha value and y value that changes relative to the loop's iteration.

Code:
var upperShadow:Shape = new Shape();
for (var k:int=0; k<10; k++) {
shadowAlpha = (1-(k/10))*.5;
trace(shadowAlpha); // traces .5, .45, .4, .35, .3, .25, .2, .15, .1, .05

[code]....

This creates a simple linear gradient since the alpha value changes linearly, but how would I go about creating some sort of exponential/logarithmic/cubic/circular value for the alpha, so that it falls off differently?

Are there a set of common equations that people use for this sort of thing, similar to the simple (1-(k/10))*.5 I use for the linear change from .5 to 0 in ten .5 increments?

View 3 Replies

ActionScript 3 :: Flash - Math.floor Acting Like Math.round?

Mar 7, 2011

Here is the problem:

var p:int = 0;
var n:Number = 0;
n = 32.999999999999999;
p = Math.floor(n);
trace(p); // returns 33
n = 32.11111111111111;
p = Math.floor(n);
trace(p); // returns 32

I would expect both of these to return 32. I have searched, and it seems this is an unreported bug in AS3. Or ... am I doing something wrong?

View 4 Replies

ActionScript 2.0 :: Create A Graph Of An Exponential Function For Interest In A Bank Account?

Sep 24, 2009

I'm trying to create a graph of an exponential function for interest in a bank account or something. Here's the code I have so far:

Code:
var i:Number=0;
var j:Number=0;
this.createEmptyMovieClip(graph, 1);

[code]....

View 2 Replies

ActionScript 3.0 :: Program To Gaph Quadratic / Exponential Equations Uisng Flash?

Apr 16, 2011

Possible to program to gaph quadratic or exponential equations uisng flash.

View 1 Replies

ActionScript 2.0 :: What Is The Diffrence Between Math.floor And Math.round

Sep 26, 2005

Wat is the diffrence between these two?

View 2 Replies

ActionScript 2.0 :: [F8] Math.round And Math.ceil?

Feb 16, 2009

I have a code in which I have to use Math.round if a certain value is for example 3.67 (67 is higher than 50) and Math.ceil if a value is for example 3.23 (23 is lower than 50). What can I do to make flash calculate if what after the dot �.� in 3.23 (for example) is higher than 50?

View 2 Replies

How To Change Filter To Bi-Linear

Nov 17, 2010

When I rotate an external loaded image it gets a different filter than the other embedded images. Like this:
What can I do to change the filter from "squares"/gitter to bi-linear?

View 9 Replies

Flash - Create Image Slider Like Nivo Slider With Builder

Jan 10, 2012

I'd like to build image slider like Nivo slider with Adobe Flash Builder.

i'd like to have image controls, image titles displayed above the image(like layers in flash). i'd like to read the data from xml.

i'd like to have nice transitions between images.

mayebe u can provide tutorial or source code.

View 1 Replies

ActionScript 3.0 :: Linear The Interpolation Function?

Mar 22, 2009

Is there a function in AS3 where it interpolates between 2 values as if it were 0-100? For the After Effects users, it's the linear(val1, val2, 0, 100) I think, where it would "normalize" values 1 and 2 and interpolate as if it were 0-100.

I have 2 circles that are acting as the tape in a cassette tape music player, and as it plays, one spool shrinks as the other grows. It's easy to get the scaling, but I need it to start at scale = .5 and end at 1.If I just add and subtract values, it'll grow past 1 or get incorrect size results.

Code:
function changeTape(timeE:Event):void {
var percentPlayed:Number = (channel.position / sound.length);
left_tape.scaleX = 1 - percentPlayed;

[code]....

View 2 Replies

ActionScript 3.0 :: Getting A Linear Interpolation Function?

Jan 21, 2012

Is there a function in AS3 where it interpolates between 2 values as if it were 0-100? For the After Effects users, it's the linear(val1, val2, 0, 100) I think, where it would "normalize" values 1 and 2 and interpolate as if it were 0-100.I have 2 circles that are acting as the tape in a cassette tape music player, and as it plays, one spool shrinks as the other grows. It's easy to get the scaling, but I need it to start at scale = .5 and end at 1.If I just add and subtract values, it'll grow past 1 or get incorrect size results.

Code:

function changeTape(timeE:Event):void {
var percentPlayed:Number = (channel.position / sound.length);
left_tape.scaleX = 1 - percentPlayed;

[code]....

View 3 Replies

Flex :: Linear Gradients Library?

May 15, 2010

Is there a place online where I can find like 16 linear gradients that match good with each other? I need them for a chart of mine and the ones generated (by Flex) aren't good enough.

So, I'm kind off searching for a library of gradients (linear in my case).

View 1 Replies

Actionscript :: Linear Tree In Flex?

May 5, 2009

<mx:Script>
<![CDATA[
private function openAllNodes():void {
tree.openItems = dp..node;
}
private function closeAllNodes():void {

[Code]...

Unless or other wise i click my parent list, the child or the next list must be in a disabled state.

I click on Child 1, then only Child 2 Must be able to select.

View 1 Replies

ActionScript 3.0 :: Any Way To Do Linear Alpha By Tweens?

Jan 6, 2010

I am just starting test Flash CS4 Pro. I am trying to do my first wery simple project. I found from this site [URL] where is nice sub menu effect where menu fading from up to down. I have done text based buttons so is it easiest way do this linear alpha by Tweens or just using some how timeline?

View 6 Replies

ActionScript 2.0 :: Linear Sequence Of Tweens?

Jan 12, 2005

I have my actionscripts tweens set up. I have six different movieclips that need to move/fade one after the other (in a linear sequence). When I run the movie they all move at the same time. I thought of setInterval() but does that mean I need a unique function for moving each clip?

View 1 Replies

Actionscript 2.0 :: Can't Get Zoom Slider To Work With The Position Of The Slider

Mar 25, 2010

What I have is a map that you can click on points and it will zoom in, you can also click on a "plus/minus" buttons to zoom in and out (I even have the mouse wheel zooming in and out). The client wanted me to add a "zoom slider bar" to it so you know you could move it up and down to scale it. Everything is working except the slider, I can't seem to get it to work with the position of the slider. All of the zoom functionality is there but the slider is killing me.

I am putting up the fla file since there is a lot of code in there and I didn't want to put it all in the forum. if you look in the fla in frame ten on line 726 you can find the function that is supposed to handle the zooming when you move the slider. Up on line 74 you can find the slider onPress and onRelease functions, but those I believe should be fine.

View 2 Replies

Professional :: Non-linear Navigation With Movie Clips?

Mar 21, 2011

I am gradually learning Flash and am able to play a 56 frame movie clip in frame 5 using stop(); on the main level. What I don't know is how to move onto frame 6 on the main level once the clip is finished.

View 7 Replies

ActionScript 2.0 :: Preloader - Made A Non-linear/non-bar Type?

Mar 26, 2007

I am feeling creative & think it would be cool to have a preloader that isn't just the standard bar preloader.

What I have in mind is to have a word being spelled out as the page is loaded. So the loader 'fills' from point A to point B, but not necessarily along a straight line.

It would need to follow a path. I've seen various animated preloaders but they all seem to go along a straight line, even if bubbling or moving.

View 2 Replies

ActionScript 3.0 :: Can't Find Mx.core.linear And MovieClipLoaderAsset

Sep 9, 2010

I'm making changes to this website i didn't build everything was going fine with the xml. I have to make changes to this file called content.swf but i don't know how this file was created, i'm assuming it was created with a file called Main.as When I try to export Main.as a swf i get this mx.core error. I know this is a flex package. I download flex sdk 3 and 4. When I try to export Main.as in flash CS5 it tells me I need to locate the flex path, so i choosed flex sdk3 and flex sdk4 on two different occasions it still wont work.

Here is the window that pop ups:"You have used a feature that requires Flex SDK:"Embed" metadata set the Flex SDK path if necessary and add it to the library path for this file. The Flex SDK folder contains the bin, frameworks, lib and other folders:

View 1 Replies

Flex :: Variable (Linear Gradient) Transparency For UI Container?

Mar 19, 2010

I would like to have a variable transparency for a Flex UI container. The upper half of the container should be completely opaque but the lower part of it should smoothly change from completely opaque to completely transparent.

View 1 Replies

Actionscript 3 :: Constrain B2Bodys' Linear Velocity Angle

Nov 27, 2010

I want to force the linear velocity direction of a b2Body to be within certain bounds.

View 1 Replies

ActionScript 2.0 :: How To Develop Nice Linear Animation (Random)

May 4, 2005

I am trying to develop some kind of nice linear animation that is kinda random but nice and organic in shape or just linear. Ok that doesn't make much sense. The outcome should be somewhere close to this : [URL]

View 4 Replies

ActionScript 3.0 :: Generating Dynamic Linear Gradient Colours?

Feb 19, 2010

Would like to know is it possible to dynamically generate a range of colours. Eg. from red to green ["0xFF0000", "00FF00"]Specifying a range of 100 in between colours Final results of an array of 100 colours ["0xFF0000", .., ..., ......, ..., ..., "0x00FF00"]

View 5 Replies

ActionScript 2.0 :: Develop Some Kind Of Nice Linear Animation ?

May 4, 2005

Im trying to develop some kind of nice linear animation that is kinda random but nice and organic in shape or just linear.

View 4 Replies

ActionScript 2.0 :: Math.min And Math.max?

Jan 16, 2004

So here is a piece of code that I have seen used a lot but don't really quite understand:

myVar = Math.min(Math.max(myVar, this.min), this.max);

or some variation thereof. I understand that the function first finds the maximum value of two values then turns around and uses that to find the minimum between two values.why this is done? And how do you know when to use it?

View 3 Replies

ActionScript 2.0 :: Math.min And Math.max

Jan 16, 2004

So here is a piece of code that I have seen used a lot but don't really quite understand:[code]or some variation thereof. I understand that the function first finds the maximum value of two values then turns around and uses that to find the minimum between two values.And how do you know when to use it?

View 3 Replies

ActionScript 2.0 :: Slider To Drag Another Slider On Collision?

Dec 1, 2009

I am trying to create a basic timeline, similar to the timeline we all use in flash (see attached).

I have a playhead slider, which when dragged, just drags within its startDrag() limits.

I also have horizontal window scroller which also when dragged, just drags within its startDrag() limits.

I am trying to work out how to get the horizontal window scroller to scroll when the playhead slider hits the left or right edge. I am using hittest for this collision.

I have the playHeadSlider scrolling along the top. When playHeadSlider collides with hittestThing I want mcContents to then move.

It kind of works.. mcContents moves when the playHeadSlider is in collision with the hittestThing.. but it just moves rather than 'drags' across. I have it set up so that mcContents is twice the width (approx) of mcScrollWindow.

I need to somehow update what I have so that if the playHeadSlider collides with hittestThing on the right, mcContents only moves to the right and if playHeadSlider collides with hittestThing2 on the left, mcContents only moves to the left.

View 0 Replies







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