ActionScript 3.0 :: Adding Another Set Of Values After Hitting A Button?
Jan 21, 2010
Right now I have a drag and drop exercise that will output a value based on the drop positions of 2 points. What I would like is to be able to add a button that basically has a whole new set of outputs based on the same drop positions. Here is an example. If I place an object on drop target 1 and 3. The output says something like "good job". Now if I click a button and place and object on 1 and 3 the output would say "try again". I hope this makes sense. I would also like the ability to add more than one button.
View 2 Replies
Similar Posts:
Jan 26, 2010
I have a simple drag and drop project. I have 2 drag able objects and 4 drop targets for those objects. I also have output text that gives a message depending on what target the objects are drug to (1 and 1, 1 and 2, 1 and 3, 1 and 4, 2 and 1, 2 and 2, 2 and 3, 2 and 4 and so on). I would like to add a button to this project. I want the button to change the output text. So if you had an object on 1 and 2 then hit the button it would read "1b and 2b" and so on, or anything else I want it to say. If you hit the button again it would go back to the original text "1 and 2".
View 1 Replies
Aug 1, 2010
Im making 6 buttons all with different values. When you press one button the number that button holds will show up in 2 dynamic textfields.In the first field the numbers will come upp in a list form, one under another.and in the second textfield the number that the buttons have will add up.I have tried for some days now but cant come up with anything that worked.Haved tried with thisfor one button:
totalsum.text += Number(totalsum.text) + 22;
and this for the next:
totalsum.text += Number(totalsum.text) + 33;
[code]......
View 3 Replies
May 15, 2009
I'm using mx2004.I have 2 variables, craft and avilablepoints, now when you hit the crafting button, it subtracts 1 point from avilablepoints, and adds 1 to the craft variable. I got that coded without an issue. I'm having trouble setting up the button to stop adding when availablepoints hits zero. Here is the code I have so far...
on(release) {
craft++;
avpoints--;
}
I had more code, but nothing worked for me.
View 2 Replies
Jan 15, 2009
What I would like to have happen is when I click on a button, a movie clip rolls out. When I click on that same button a second time, I want the movie clip to roll back in. Right now it works for me to click on the button once and my movie clip roll out, but when I click on it again, it just rolls out again. Here is what Im working with so far:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var inTween:Tween;
[Code].....
View 2 Replies
Apr 29, 2010
i have managed to create a pswd protected flash animation which is working good when the pswd is given and by clicking the submit btn. What I want is, instead of clicking the btn, i want it work when i hit the enter key.
[Code]..
View 2 Replies
Feb 26, 2012
I'm sure I'll receive some sort of hate for posting this in the wrong area, but I'm really desperate for help and don't feel like searching further for the "correct forum." Anyway, I created a swf for the "education" page for a liquor store, it navigates through wine, beer, and liquor. All the links work well, however after you go to (for example) the liquor page, when you hit the "back button" on the browser, going back to the page with my swf file, the movie freezes after the first animation. I don't understand it, it only happens with firefox, which to my knowledge is one of the more progressive browsers, so what gives?! It even works perfectly on IE and my android phone, so I'm at a complete loss, as I'm more a designer than programmer. Please take a look and offer any obvious advice. I would be willing to make the video in AS3 if that is the only option, I just have no clue how to implement AS3... so confusing. The link to the swf in use is: http://www.whitehorsewine.com/education.php Each book having a button that triggers a movieclip with AS2. The movieclips all have stop(); at the end of them. The rest of the coding is in the timeline on a seperate layer:
[Code]...
View 3 Replies
Aug 19, 2011
When publishing to iOS device the game plays well, when hitting homebutton it disappears as normal, but next time you open it - it starts to play at the state or level it was when quitting - as it only was paused. It should start up from default startupscreen.
ps we had an 103 error that we solved with this: [URL]
View 1 Replies
May 28, 2003
fspaiva just posted a thread with a scale script [URL] attached to a movie is attached this script :
[Code]...
when i try this script and watch the CPU monitor of the computer, after hitting one button this movie keeps eating cycles and a lot of it, meaning after the movie has adapted to it's new set scale, so tried if adding an "if" in the script could stop that :
[Code]...
but that doesn't work, the CPU keeps peaking, so my question is, should i worry about these things? if so what to edit to make that more efficient?
View 14 Replies
Jan 9, 2004
I have a simple flash form, which has some required fields, ie. name, addy, etc. What I want to do, is validate that the fields have been filled before they can hit the "next" button.
View 6 Replies
Jul 21, 2011
Our testing department found that my flash menu sometimes doesnt work after going back to a page by clicking Back button in browser (Firefox).
It happens rarely and randomly, yet still it happens.
i cant see any pattern in its behavior and any reason in it.
[URL]
i've tested this in every way i could think of,
it gets ROLL_OVER event, but not CLICK event.
ive also tested it with hasEventListener and it always has. its just not triggering function.
BUT clicking anywhere on page outside flash makes it work again.
Question: whose fault is this? Flash? Drupal? Firefox? God?
UPDATE: it looks like its caused by <param name="wmode" value="transparent"/>.
Firefox seem to have problem with that.
[URL]
View 3 Replies
Apr 5, 2011
Haw can i add Array of value which user inputs. i just started learning and this is what i could do as of now
public function get Values():Array
{
return _values;
}
[Code]....
View 2 Replies
May 10, 2006
I am putting together a game where you fly a plane by pressing the arrow keys.
They acritionscript below handles that nicely. But I want to add boundaries so the plane will stay on the stage and not fly off it...
But I haven't been able to accomplish without bringing the plane movement to a complete stop.
adding the xposmax = 500 & yposmax = 300 to my actionscript. So the plane will stay inbetwenn x (0-500) and y (0-300).
gravity = 0.1;
fall = 0.1;
xpos = 0;
[Code]....
View 2 Replies
Oct 8, 2009
i also tried with leaving the == true off - adds to zero The code files are at [URL]
New Code
Code:
substance.text = myVars.substance;
sum.text= myVars.sum;
score.text = Score;
[Code].....
View 1 Replies
May 17, 2009
I meant to call it "Convert a value to a variable". Using CS3, AS2: If I have a variable that's a string value = the name of another variable, can I extract the value and then look for the extracted value's matching variable name to get it's value?
Ex:
color = "blue"
box = "color"
(Assuming I don't know the value of box) How would I get the value of "box" out so I could search for the value "color" as if it were a variable? I need to convert a value to a variable name is what i'm getting at... I think.
View 21 Replies
Aug 23, 2010
I meant to call it "Convert a value to a variable".Using CS3, AS2:If I have a variable that's a string value = the name of another variable, can I extract the value and then look for the extracted value's matching variable name to get it's value?[code](Assuming I don't know the value of box) How would I get the value of "box" out so I could search for the value "color" as if it were a variable? I need to convert a value to a variable name is what i'm getting at.
View 4 Replies
Apr 21, 2011
I am trying to find the sum of one column's timings which is like '00:00:00' format. I am splitting the time string at ':' and storing into an array. Then trying to add array1[1] value to array2[1] value. Here I'm not getting type casting logic. I'm getting an error when I give int(array2[1]) += int(array1[1]) .
View 2 Replies
Oct 8, 2009
i also tried with leaving the == true off - adds to zero The code files are at [URL]
New Code
Code:
substance.text = myVars.substance;
sum.text= myVars.sum;
score.text = Score;
[Code].....
View 0 Replies
Dec 13, 2010
I'm trying to find a way to manipulate an array; well, two, actually, but I suspect one solution will fix both.
I have an comma-seperated string of numbers pulled from an xml file, that correspond to the correct answers in a multiple-choice exam app I'm working on. The numbers will always appear low to high, but there could be any number of them up to a maximum of 10, for example:
1,3,5
2,3,5,7,8
1,2,8,9,10
I've seperated the list out into an array, but what I'm eventually going to need to do is to compare this array with another array containing the user's answers. The array of their answers won't necessarily have the same number of values as the array of correct answers.
So, I'm thinking one way round this would be to add zeros in between the numbers in each array, so that they will both have the same number of values. To re-write the example arrays above, these would be manipulated to:
1,0,3,0,5,0,0 (for 7 possible answers)
0,2,3,0,5,0,7,8,0 (for 9 possible answers)
1,2,0,0,0,0,0,8,9,10 (for 10 possible answers)
I can then follow the same process for the array of user's answers (which could be almost anything, but will be limited to the maximum number of responses, i.e. 7 for the first array in the above list), and then run a function to compare the two arrays, which will, after adding the zeros, have the same number of values.
I've made several attempts at this, but keep getting tangled up in loops and if statements... I'm not exactly an Actionscript ninja, as you may have guessed by now!
how I can approach the above, or know of an existing script that will do what I'm after?
View 9 Replies
Sep 2, 2005
I have a movie that contains a series of radio button groups, which each have their own accompanying dyn text box. When a certain radio button is selected, a pre-determined value is loaded into each respective groups' text box, via "onRelease".
Now, I can get these values to appear fine in each text box, but I then have a fourth text box (amount_total), into which I want to have the sum of all the previous text box's values.
I have a submit button with the following actions on the first frame of the timeline:
onSubmit = function (){
_root.amount_total = Number(_root.total_surf) + Number(_root.total_music) + Number(_root.total_video);
}
Now, when I hit the submit button NaN is returned.
View 2 Replies
Sep 18, 2006
I'm not a programmer but have been using Flash for awhile. This is my first heavy dive into variables.I'm putting together a Quiz game where I pull the information from a txt file. I can get everything to display and work fine except for the adding of a total score.I have a series of values in a text file and load it into my movie. Depending upon what button I push, I want to take the value and add it to the total score. The next button I push I want it to add that value to the new total score.
View 3 Replies
Nov 20, 2007
is it possible to add the values from a string to an array?For example my string looks like this:
var bookmarks:String = "book1, book2, book3";
And I need to add these values to the end of an array?
View 2 Replies
Sep 20, 2009
how do i go about adding the values of array items together? basically i have an array of randomly sized rectangle sprites and i want to find their total length (as if they were lined up end to end)
View 3 Replies
Dec 26, 2009
I have 7 Dynamic Text Boxes, each with a numeric value.. I need to add them together.
Total = (ST2 + DO + GA + BO + CT + HT + TI);
This makes it 0000000 (Assuming each Dynamic Text had a 0 in it)
Total = (ST2 ++ DO ++ GA ++ BO ++ CT ++ HT ++ TI);
Gives errors. How do I do Simple Addition? It's been so long.
View 1 Replies
Mar 13, 2008
I have a flash file which loads in vars from director. It then adds the values to a graph. The amounts from the string are inputed into text fields. the fields are named energy, waste etc. I want a textfield to output whichever sections that are over 5 saying "well done, you have excelled in water, energy...... I have got this working but am stuck on this bit: I am wanting to add an "and" before the last item, so it outputs as "well done you have excelled in water, waste and energy". Also if only one item is over 5 it wont add the "and". This probably doesnt make any sense, heres my code anyhow:
Code:
var summary_results = "2000,6,3,10,8,6";
var txtFields:Array = [Total,Energy,Waste,Water,Food,Transport];
var excelledItems:Array = [];
var theValues:Array = summary_results.split(",");
for(var i=1;i<theValues.length;i++){
[Code] .....
View 1 Replies
Apr 9, 2008
I have 3 dynamic text boxes on the main movies stage that are getting their values from an externally loaded swf. If statements within the external movie loads the values from an xml file depending on which action is selected by the user. Now I have a fourth text box that needs to gather all the values that are loaded in the other 3 and add them together...placing zero if nothing is loaded. I have done various code tests...I get either NAN or _level0.total ...total is the instance name of one of the boxes, I am trying to access.
View 2 Replies
Mar 29, 2010
I am trying to calculate the values on user entered text fields (which only accept numbers) along with the values of user selected combo boxes. I have a function to a button:
reviewQ.calcBtn.addEventListener(MouseEvent.CLICK, calcAns);
function calcAns(e:MouseEvent):void
{
reviewQ.calcAns_text.text = "Your calculated result is " +
[Code]....
Right now, all I am getting is the actual values entered in the text fields and selected in the combo boxes. How can I get the sum of this values to show on my "calcAns_text.text"?
View 6 Replies
May 23, 2009
While a for loop runs through all the elements in an array I want to get the width of each element and add it to the sum of the width of all previous elements.
View 2 Replies
Jan 21, 2011
I am running into some trouble adding an array into another array to create a multi-dimensional array.The code appears as below:
var slideDataArray:Array = new Array();
var slideShowDataArray:Array = new Array();
slideDataArray[0] = xmlData.SlideShowParameters.SlideShowImagesDirectory;[code]........
I am looking for a means of placing the slideDataArray into a 'slot' or value of slideShowDataArray so that I can in the end pass the slideShowDataArray as a parameter to another function.As of now, the last slideDataArray appears 11 times (the loop runs 11 times) in slideShowDataArray and the way the code is written the slideDataArray is unique every iteration of the loop.
View 1 Replies
Jun 21, 2010
well, i want to make an event occurred when object X hits any instance from a certain symbol Y lets say there's 10 instance of symbol Y rather than naming each of the instance obj1, obj2, etc and making a hitTest event for each of the instance, is there a way to make this event occurred when object X hits any instance of the symbol Y?
View 2 Replies