Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Make The Thermometer Increase And Decrease



Hi guys and girls, Im working on a project that requires the user to be able to increase and decrease the temperature by pressing a button. At the moment i have got it to work using "next frame" action script on the increase and "prev frame" on the decrease button. when the user presses increase, it goes to the next frame which then plays a movie clip ( the movie clip shows the temperature fade out and then fade in). My problem comes when the user wants the decrease the temperature, so when the user presses the decrease button it just goes back to the beginning, so its in a loop. What i would like to happen is for user to press the decrease button and the movie clip to play in reverse order. i have the link here for you guys to have a look http://www.colourchange.com/clini-temp/ and clarify what i mean I have also attached the fla aswell http://www.colourchange.com/clini-te...-temp-test.fla i need to brush up on my Action Scripting, seriously.



KirupaForum > Flash > ActionScript 3.0
Posted on: 09-12-2007, 01:16 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Increase, Decrease Box Size
Can someone help?

I have a rectangle that is a movie and it's instance name is box. I want to enlarge and decrease the size with actionscript and not frame animation. I thought I would do this with two seperate buttons, once called zoom in and the other called zoom out. Can I do this and how?

Detect Increase/decrease. . .
I wish to write a function or piece of code that conditionally responds to whether the user is moving their mouse to the right or to the left.
In other words, if the _xmouse is increasing, do one thing. If _xmouse is decreasing, do something else.

I know how to make things update or increase using incremental operators, etc. But how would I simply check to see if someone is dragging to the left vs. to the right?

As a further example, if the mouse position is increasing towards the right at any given time, I want a movie clip to respond one way.
If the user suddenly decides to move the mouse more to the left, I want it to respond another way.

Increase/decrease Power Bar
Hello!

i have a power bar (PowerMC). It's width is '0'.

On the power bar, I have these actions:

onClipEvent(enterFrame);{
If(this._width<100);{
this.width = this.width+2;
}
}

What this does is make my PowerMC slowly get bigger

When it reaches 100, I want PowerMC.width to DECREASE by 2.

I tried this formula and it doesn't work:

onClipEvent(enterFrame);{
If(this._width<100);{
this.width = this.width+2;
else if(}this._width=100);{
this.width = this.width-2;
}

Any ideas guys and dolls?

Scale, Increase/ Decrease .x, .y, Etc, Etc
Last edited by Lisbeth : 2002-06-14 at 11:17.
























I want Lizzy to be able to walk forward and into the city. The city will therefore have to be scaled while Lizzy is walking! On a scale from 0-10, how are the chances that a dumb chick like me can make this happen?

Take a look here to see what I mean:

Demo

There must be a .fla somewhere that I could work with, but I haven´t found any. Please try to give me a hint, people! It will be days before I am online again, so this is my last chance now!

Increase, Decrease Textfield Size
is it possible to increase and decrease the size of a dynamic text box?

i would like the user to be able to increase and decrease the size of a text box both horizontally and vertically without physically stretching the text inside.

tnx

Increase And/or Decrease Size On Flash Mx
Ok... in my website I have three buttons. What I want to do, but still haven't figured out how, is to perform an action in wich if I rollover a button, this will increase its size to a certain value, decreasing the size of the other two at the same time, and on rollout the three of them would go back to their normal size.
What I've done so far is put three movieclips on a layer on the scene with invisible buttons over them on a different layer. All three buttons are the same size so there won't be much trouble defining the desirable "big" and "small" size for all of them

I tried to set variables for the height and width and make flash check it on a loop, but what I haven't figured out yet is the action for the buttons to make the size animation change.

Thanks in advance.

Increase And/or Decrease Size On Flash Mx
Ok... in my website I have three buttons. What I want to do, but still haven't figured out how, is to perform an action in wich if I rollover a button, this will increase its size to a certain value, decreasing the size of the other two at the same time, and on rollout the three of them would go back to their normal size.
What I've done so far is put three movieclips on a layer on the scene with invisible buttons over them on a different layer. All three buttons are the same size so there won't be much trouble defining the desirable "big" and "small" size for all of them.

I tried to set variables for the height and width and make flash check it on a loop, but what I haven't figured out yet is the action for the buttons to make the size animation change, as well as the rate of this change.

Thanks in advance.

Gradual Scroll Increase And Decrease?
Hey all. I followed a tutorial on making a gallery.
http://www.cwd.dk/article.asp?articleid=102&pageno=1

The pictures scroll left and right. The thing is that they start very abrupt, not smooth. I've seen lots of scroller where they speed up gradually and slows down gradually as well. This one just scrolls instantly. Here's the actionscript:

movespeed = 5;
if (_root.scroll._x<=-521.4)
{
gotoAndStop (1);
}
else {
_root.scroll._x -= moveSpeed;
}

This just scrolls the images at a speed of 5. How can I make it so that the moveSpeed will increase gradually over time? Thanks y'all!

Increase/decrease Movie Numbers?
Ok basically i have a series of movie clips named 0001.swf 0002.swf etc etc, now what i want to do is create a button to load the next swf in the sequence any ideas? I was thinking i might have to declare a global variable on the main time line and then have the button increase or decrease its number then load in the corresponding swf.... Any help would be much appreciated

[F9] How To Increase/decrease MC Speed With A Slider
I am trying to figure out how I can control a movie clip to speed up or slow down with a slider.

Basically you have a slider as you move it more to the right a movie clip will move faster. I know that Flash FPS will remain the same but I know that you can do it with setInterval but not sure how to implement it.

thanks

[F8] Turn Knob To Increase Or Decrease Var?
Hiya

I am trying to make a knob which can be turned by dragging and subsequently increase or decrease an arbitrary value depending upon the direction turned.

I've got the 'turning knob' part working, but am running into trouble applying its rotation to my variable.

I need to be able to accommodate an initialValue, minValue, and maxValue.

Here's what I have:


Code:
var mouseListener:Object = new Object();
var radians:Number;
var degrees:Number;
var down:Boolean = false;
var minLimit:Number=0; // could be anything
var maxLimit:Number=1200; // could be anything
var initValue:Number=10; // could be anything
var increment:Number;

clip.onPress = function() {
down = true;
};
clip.onRelease = clip.onReleaseOutside=function () {
down = false;
};
mouseListener.onMouseMove = function() {
if (down) {
radians = Math.atan2(_ymouse-clip._y, _xmouse-clip._x);
degrees = Math.round((radians*180/Math.PI));
increment = degrees;

if(degrees<0){
increment=((180+degrees)+180) // works up to 360 - what do I do after that?
}

clip._rotation = degrees;
test.text=increment;
}
};
Mouse.addListener(mouseListener)

Many Thanks in advance!

Increase/decrease An Element Size
Dear all!

I am working on a project, in which I need to make an object increase to 150 and decrease to 25% from ite regular size, by pressing the Key.UP on my keyboard. My problem is that i can not get it to increase gradually as I press the Key.UP.

I am also programming a previous channel on remote control. The pc is suppost to go to previous channel when I press the button. I tried different ways, but I don't know how to make the function remember what was the last channel..
Please help or give some hints.. I'll appreciate your help

Increase Or Decrease Playback Speed
Is there a way to increase or decrease the playback speed of an FLA? Something that will alter the frame rate of a swf that is playing? I have been having a hard time finding too much about this. Any tips, hints, a tutuorial somewhere perhaps?

thanks

Increase/decrease Movieclip Size Help
Hi

I have a movieclip slider_mc that can be dragged across the screen. There are also lots of small movieclips on the stage that I would like to increase and decrease their size depending on how close the draggable movieclip is to them. If you know what I mean please can you help!
Thanks

A

Increase/decrease Total Buttons
Hey!

I am aware that the title might not be the most self explanatory but I'm not sure what to put?!?

I am making a demo of a gambling game and am stuck right at the very beginning

I want to do as much of this myself before I hand it over to the advanced flashers so I can learn new things but I am aware this is ridiculously easy.

I have 2 buttons and a dynamic text field. I want one button to increase the bet by £10 and the other to decrease it by £10. The amount should change in the textfield.

This I have done. But how do i set a minimum bet of £100 and a maximum of £500 so that it wont carry on decreasing once it reached £100 and so on and so forth....?

Cheers,
Mags x

Infinite Symbol Increase/decrease
hi everyone,

I want to make a simple coming soon page where the text "coming soon" (a graphic symbol I suspect) occupies the entire stage and slowly shrinks infinitely to the point where it can no longer be read.

Anyone know the script for this pretty please

Thanks.
-sean-

Increase/decrease Movieclip Size Help
Hi

I have a movieclip slider_mc that can be dragged across the screen. There are also lots of small movieclips on the stage that I would like to increase and decrease their size depending on how close the draggable movieclip is to them. If you know what I mean please can you help!
Thanks

A

Annoying Little Increase/decrease Problem
I'm trying to increase/decrease the number of a text field, and increase/decrease the size of the font in another. Everything works, sort of.

I have a text field called "preview" (which I'm changing the font size in), a text field "newsize" (which I'm changing the number in), and 2 buttons, 1 with the 'increase' code and 1 with the 'decrease' code.

If I click the decrease code, everything goes down like it should, and then if I click the increase button, everything works. But if I click the increase button first, it just adds 1 to the existing newsize field (it's default 10, so a click makes it 101, and the font size 101). But then if I click the decrease button, it all decreases like it should, and then I can turn around and use the increase button and it works like it should.

increase button:

Code:
on (release) {
myTextFormat = new TextFormat();
currentsize = newsize;
newsize = currentsize + 1;
myTextFormat.size = newsize;
_root.preview.setTextFormat(myTextFormat);
}

decrease button:

Code:
on (release) {
myTextFormat = new TextFormat();
currentsize = newsize;
newsize = currentsize - 1;
myTextFormat.size = newsize;
_root.preview.setTextFormat(myTextFormat);
}
Can anyone let me know what the problem is?

[F8] Increase / Decrease Sound Volume Button
Im using the following to control the volume.
when you press the button it goes up and down by 25
It works but its bugged.
When it reaches 0, you need to press button one more time to turn off sound so that'd be -25.
same thing in increase. Sound turns on at 50 but not 25

Code:
var volume_variable:Number = 100;
s.setVolume(volume_variable);


onEnterFrame = function(){
decrease_btn.onPress = function(){
trace(_root.volume_variable);
s.setVolume(volume_variable);
if (_root.volume_variable == 0){
_root.volume_variable = 0;
}
else{
_root.volume_variable -= 25;
}
trace(_root.volume_variable);
}

increase_btn.onPress = function(){
s.setVolume(volume_variable);
if (_root.volume_variable == 100){
_root.volume_variable = 100;
}
else{
_root.volume_variable += 25;
}
trace(volume_variable);
}
any ideas?

On Click Increase/Decrease Font Size
Morning Everyone.

I have a presentation that is filled from an XML file. All the text boxes are dynamic, loops go through and populate clips and what not.
I want to add a function, that if they click on the big "A" it increases the Font size by 1 pt. so 12pt>13pt The little"a" would Decrease the font size. 13pt>12pt.

To start, I just want to increase/decrease by 1 pt. but if later I can make it so each click increases/decreases that would be ideal.

Not sure if this is possible, but I wanted to toss the question out there as I do my own research as well.

Appreciate it!

Tim

Help With Defining A Function To Increase Or Decrease A Number
Situation:

1. The are two buttons
2. If you click the first one a number is increaded by 1
3. If you click the second one the same number gets decreased by 1
4. For each there is an IF statement which starts a certain action

I can't figure out how to make this work. The following script returns only one number and thus starts only on action:

function ClipSelector(i:Number):Number {
i++;
return i;
}
var nDummyVar:Number = 0;
var nSelectorValue:Number = ClipSelector(nDummyVar);
if (nSelectorValue == 1) {
trace("blah");
}
else if (nSelectorValue == 1) {
trace("blah");
}
//output: bla

Increase/decrease The Speed Of My Motion Tween On MC
I have a movie clip("mc_logos")on the stage, and inside the "mc_logos" are 35 logos. Then I have 2 buttons that can increase/decrease the speed of my motion tween of my "mc_logos" clip on the stage.

How can I make the 2 buttons work?

Increase/decrease Font Loaded In Dynamic Text Field?
Hello, is there a way to add a plus and a minus button to increase/decrease font that is being loaded into a dynamic text field? The pixel font is set to 8 so I'd increase it to 16 if the user is having trouble reading the small text.

Buttons To Increase Or Decrease Font Size In Externally Loaded HTML Formatted TXT.
My MX movie loads external HTML formatted text from a var.txt file using loadvars().
Var.txt looks like this:

&varPresentation="'<'P ALIGN="LEFT"'>''<'FONT FACE="Verdana" size="11" color="#000000"'>''<'B'>'This is the text for the 'Presentation' window.'<'/B'>''<'/FONT'>''<'/P'>'"

txtbox.MC has this code added to it´s only instance:


Code:
onClipEvent (load){
TheText = _level0.txtLoader.varPresentation;
InstanceName_0.html = true;
InstanceName_0.htmlText=this.TheText;
}
It works fine, now i´m just trying to make a '+' button and a '-' button to dinamically increase or decrease font size in txtbox.MC.

The txt field is named InstanceName_0 so i created a '+' button and added a instance of it to txtbox.MC with this code:


Code:
on (release) {
this.InstanceName_0.htmlText.SIZE++;
}
And it does not work.
Any ideas?
[Edited by Effenberg0x0 on 07-19-2002 at 04:38 PM]

Mouse Rollover On One Movie Clip Increase Decrease Alpha Of Another Movie Clip..
So I really haven't messed with Actionscript much for a couple years and here is my issue.

I have several movieclips I put together that will eventually be a menu for my website. When you roll over a menu option (movieclip) I am trying to get another movie clip to fade in giving the description of the menu item.

For example - when you roll your mouse over the 'Live Chat' option a brief text description would appear telling you what the live chat is about. This description is a seperate movie clip appearing away from the original menu.

I have made the movieclips for the menu and the movie clips for the descriptions. I tried this action on the menu option to get the description to fade in:


Code:
onClipEvent (load) {
this._parent.mc_text_discussionBoard._alpha = 0;
}
onClipEvent (enterFrame) {
this.onRollOver = function() {
if (this._parent.mc_text_discussionBoard._alpha<100) {
this._parent.mc_text_discussionBoard._alpha += 5;
}
};
}
But the alpha only increases on the description (mc_text_discussionBoard) by 5 when I keep rolling my move over and out and over again. It makes sense why it does that, but I'm not exaclty sure how to get it to continually increase the alpha by 5.

any help would be great and I am anxiously waiting to get this solved!
Kevin

How To Increase Speed And Decrease Speed "movieclip" Using Buttons
I am building a flash game and was wondering do anyone know how to make a variable/button increase speed and to decrease speed of a movie clip.

Thanks

Need To Visually Make A Number Increase (count Up)
Hi everyone,

I'm working on a Flash animated graph that will be showing 3 bars raising gradually, but I want to show a number counting up for each bar, and that's where I need your help.

The first bar needs to show a pretty quick number count-up going from 0 to 3 (0.01 increments)

The second bar is a number that quickly goes from 0 to 450 (increments of 1)

The 3rd bar is a number that quickly goes from 0 to 200 (increments of 1)

Each of those 3 statistics have to reach their highest value almost at the same time as much as possible...

Oh and I would need to be able to chose the font and color for those, not just plain text.

I looked it up and couldn't find what I needed.

Any suggestions, tutorials, actionscripts would be very appreciated

Thanks

How To Gradually Make An MC Alpha Increase Slowly?
I have a movieclip start out with an alpha 0f 0.
Later when an event is toggled I have it run:

_root.Logo_main.bannertext._alpha=100;

BUT the alpha goes to 100 instantly.
I would like for the alpha to increase gradually, as if fading in.

Thanks in advance.

A Way To Increase My FPS And Automatically Increase My Timeline Lenght
I wanna move 24 frames per second (fps) from the existing 12 fps to make tha animations smoother. BUT i wanna that my animation have the same length time ....

if there is anyway to make that but not manualy

A Way To Increase My FPS And Automatically Increase My Timeline Lenght
I wanna move 24 frames per second (fps) from the existing 12 fps to make tha animations smoother. BUT i wanna that my animation have the same length time ....

if there is anyway to make that but not manualy

Script For Thermometer
I am making a site for my dad-in-law. He wants a thermometer that has real time temp of Tampa. Want to make it as simple as possible. I have the movie setup but need scripting to check a site like weather channel to get temp an display in a text this will also move mercury in themometer. Any ideas, sources, etc. would be helpful!!!!

Graphical Xml Thermometer
i want to build a graphical thermometer in flash that is updated using xml data . Can anyone help on info or sources to do this?

Graphical Xml Thermometer
i want to build a graphical thermometer in flash that is updated using xml data . Can anyone help on info or sources to do this?

Flash Thermometer
HI guys --

I am not new to flash but havent used it in a while!

Can anyone think of a step-by-step process to build a flash thermometer animation??

The red bit would go up or down according to an amount that someone has fundraised for charity..

firstly - how does one do the red bit & secondly the link to the amount

and im not 100% sure how to link this amount?
It would be something like 20% of £200 raised and could come from a database..

Many thanks in advance

Dynamic Thermometer
Hi there

I am designing a thermometer (flash 8) that will read a variable to animate the red portion of the thermometer to reach the given temperature.

I am told this will be done by passing the value via php (which is over my head), but for now to get a working model I can start by having flash read a value from variable in a text file.

Can anyone help me get started on this with the logic and actionscript? I am novice-level in programming.

thanks!
Steve

Thermometer Guage
Hi,

I just need a little guidance please:-

I'm trying to animate a linear thermometer. I have 4 layers....

Action
Background
Thermometer Scale
Needle

... and Symbols for most graphics

The needle layer has a tween that runs from 0 to 99 degrees using 100 frames and a ease to give a bit of life. I'm stuck on what to use to play the needle tween a given number of frames according to a value read from a text file.

1) How do you play a tween from frame 1 to frame x then stop?
2) Apply the ease to the shortened frame 1 - frame x tween
3) Read a value from a text file?

I just need pointing in the right direction. I can probably work out AS code from the reference but any examples would be much appreciated.

Thanks in advance.

Nigel.

Goal Thermometer?
I need to make a Goal Thermometer work dynamically. I have made the symbols and all in Flash and now need to make it work.

All my experience in Flash has been "cell" animation (all Timeline - no ActionScript'n) but now my manager wants this goal thing to work for different departments to see on the intranet (after they login...)

How do I pass the value to the symbol [redbar] to make it grow?? I know I have to make some kind of percentage calculation like (goal_achieved/total_goal)*100 which will be done in the HTML but how do I get value received into the SWF???


sorry but AS confuses me (I'm just a lowly pixel monkey)

thanks for any help you guys can offer,
scott

Dynamic Thermometer
Hi there

I am designing a thermometer (flash 8) that will read a variable to animate the red portion of the thermometer to reach the given temperature.

I am told this will be done by passing the value via php (which is over my head), but for now to get a working model I can start by having flash read a value from variable in a text file.

Can anyone help me get started on this with the logic and actionscript? I am novice-level in programming.

thanks!
Steve

Action Script For Thermometer Help
Hi guys/girls

I am creating a thermometer and i would like to create a piece of action script that allows the user to increase or decrease the temperature by pressing a button.

i have created a version for which you can see at http://www.colourchange.com/clini-temp/.

Currently it works by have action script on the up button to simply go to the next frame, however i encountered a problem when the user tries to decrease the temperature.

i just cant get my head around it.

any ideas and advice are welcome.

cheers

Anyone Done A Flash Thermometer Animation?
HI guys --

I am trying to find a way to do a thermomenter animation in flash - the mercury in the thermometer would be linked to a percentage ie 85%

In the beginning - this can just be an amount from some place else in the flash file...ie a set percentage 85%

But moving on -- I am not sure how exactly i would do the scripting for this!

or even add a script in so that it looks for the percentage in a database?

Any advice?

Researching Concept - Metric Thermometer
I currently load daily performance data into an Excel spreadsheet stored on our company server. The spreadsheet calculates weekly summary metrics from my daily detail data entries. The metrics include such things as; weekly shipments, on-time-delivery and shipments past due. The resulting summary statistics are all calculated as 'percent to goal' type metrics.

I would like to develop a way to graphically and simply display the resulting metrics on our company website. Is it possible to create a Flash movie that could automatically refresh a series of 'thermometer' type animated images directly from the Excel files?

Other than to ask the question, I'm not really sure where to start. Has anyone seen this done before?

Thermometer Preloader Nested In Other Movies Not
Thermometer preloader nested in other movies not working!

Can anyone help me.

I've built a basic thermometer preloader for a file "TRACK1.swf" (200K).
This, on it's own work fine when i test the movie... the thermometer bar increases gradually then jumps straight into the movie when it's preloaded.

The script:-

//*********************************************************
onClipEvent (enterFrame) {
percent = int((_root.getBytesLoaded()/_root.getBytesTotal())*100);
gotoAndStop (int(_totalframes*(percent/100)));
}
//**********************************************************
The script above points to a movie clip with a hundred frame tween for the thermometer to show percentage loaded!!!
//**********************************************************

However, when i nest this movie (i.e. load "TRACK1" into an empty MC on another movie "NAVIGATION.swf") within another and test it on the web, the thermometer bar doesn't work.

The problem lies with "_root." in the script in that it's addressing the root movie and not the one the preloader is in.
I've tried using instead of _"root"; "this." and "_parent" but neither works properly on the web.

Can anyone suggest how i can fix the problem?
Or point me to a source file that solves the nested movies problem.

Please help.
Thanks in advance

Mark

Sound Decrease
Hi

I have a piece of background music playing.

When the user clicks on a button,another sound is played. Is it possbile to lower the volume of the background sound temporarily while the other sound is playing, then when finished, resume the background sound?

I guess the psuedo code would be something like this:-

On release()
Background sound==(20)
Play (new sound)
When (newsound) finish
Background sound (back to normal)

If anybody can help me I would be most grateful!

Thanks

Sound Decrease
So i have a sound playing on my flash project, but i would like it to have a lower volume than others, how do i go about making the volume lower?

Keypress - Decrease Value
Hi!
I'm having trouble with my script. I want a script to decrease a value each time a key is pressed. This is my code until now:

Code:
onClipEvent(enterFrame){
if(Key.isDown(Key.SPACE)){
_global.number -= 1;
}
}

I'm creating a game where the player has got 3 "tools", each time the space-bar is pressed, the number of tools should decrease by 1.
When I test my game with the code I'm using for now, the number has decreased to 0 before I've released the spacebar.

How do I create a code that decrease the number each time the space-bar is pressed, without continue decreasing if the space-bar is not released?

Please help Thanks ahead of time.

How Do I Decrease The Swf Size?
How can I decrease the size of my swf so that it doesn't take too long to load? Can I break it up somehow?
thank you for your efforts in trying to help me

Bst Rgds,

Osman Zarkani

How Do I Decrease The Filesize?
when i uploaded my movie + html, the movie wouldn't load, or it was taking an extra long time

the .swf is about 342 kb

so how would i decrease the filesize, or have a loader that says how far the .swf is loading?

Decrease Size
Ok, as usual, maby I'm waaay of on this one. But I have a vector animation (non' size changin) just a frame by frame animation. Is there any script to make the vector a pixel grafic / bitmap? and by that decrease the size of the swf? Here's the .fla if needed example

http://www.riksknas.com/kirupa/anime1.fla

Really hope there is a way
Thanks on forehand / Cris

How Can I Decrease The Fla Size?
Hi, i have a fla. that has 3 buttons and 1 bar (made in flash) and that makes my fla weight 2.2mb which i don't really know why...
How can i reduce it?

Copyright © 2005-08 www.BigResource.com, All rights reserved