ActionScript 2.0 :: Compare Variables And Choose The Highest?
Oct 11, 2006
Im working on a quiz that have 4 questions with 3 options each.Example:
Q1 Which actionscript forum has the coolest viewers?
A: Actionscript.org
B: Kirupa
C: Stylegala
Now, if the surfer choose more A options than B or C he gets one result message, if he choose more B options than A or C he gets another result message. how do I compare more than one variables?
I'm trying to cut down the amount of code I type to complete a project. Using things like ?: and &&= over the typical if statements. Is there a way to compare a single variable to a group of variables? example...
I have written some code to read and compare variables and then to jump to a particular frame based on the results (pretty simple stuff). It works fine when I use a button to trigger the code but I want it to happen automatically.
I have tried using the OnEnterFrame thingy but it doesn't work and I tried just placing the code on frame 1 and letting it do its thang but that didn't work either....
I'm using the .swf in a third party program and using the API for that program to supply the values.
here is the code:
_parent.InitializeExternalVars(); var m_varStrEndSlide; function display(){
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{ var id:int; var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
I have 3 movieclips and inside them loads external txt.files .To MovieClip number one loads 1.txt, to number two loads 2.txt and to number three loads file 3.txt.Allright everything works, but......what if I wantet to load the txt-file that has the highest number to the first movieclip example 65.txt, and to number two the 64.txt, and to movieclip 3 txt-file 63. And when there is txt-file called 66 in the folder it loads to movieclip one, and 65 loads to movieclip 2 etc... I think everybody gets the point.Is it possible, that Flash look up the txt file that has the highest value?
i have 3 variables and im executing a block of code depending which on has the highestow do i determine has the highest and the execute the code which ever has the highest
I have a shape and I want to find out what the highest y value is for an x value.Example: I have an oval, and with width 200 px. I input an x value like 78 px from the left and I want to know what the highest y value is that matches the x value (the top of the oval at point x)
i had to remove the flash built form and place an iframe over the top of the animation with an html form! (my reason was that the exported flash file always recognised keystrokes as that of an american keyboard and the @ sign came out as this "when you hover over the icons at the bottom which bring up information contained in a button, it falls behind the iframe.is there anyway in which i can make that particular button that contains a movieclip get the next highest z index to go above the iframe?FYI:-i have tried this on the button instance but does not work...
on this page .i had to remove the flash built form and place an iframe over the top of the animation with an html form! (my reason was that the exported flash file always recognised keystrokes as that of an american keyboard and the @ sign came out as this hen you hover over the icons at the bottom which bring up information contained in a button, it falls behind the iframe.is there anyway in which i can make that particular button that contains a movieclip get the next highest z index to go above the iframe??FYI:-i have tried this on the button instance but does not work...
I'm creating this shooter game. I attached a crosshair mc at the beginning with the depth set to getNextHighestDepth.However I keep adding the monsters mc dynamically when the game progresses, also with getNextHighestDepth. So the monster mc will keep overriding the depth of my crosshair's depth. how to get my crosshair mc's depth always to be on top of everything including the monster mc.I tried getNextHighestDepth()+1000 for my crosshair mc. But it was dumb because the monsters keep getting getNextHighestDepth as well. I assume that monster's depth would be 1001, 1002 and so on...
ok so in actionscript using xml I can find all the nodes of the same name using
xmlList.descendants("nodename");
and that returns me a XMLlist of those nodes that exist within the xmlList I provided all well and good but now I want to only get the one node of the returned value that has the largest value.
Do I have to loop through the resulting nodes or can I get that node without a loop maybe some other xmllist function I'm not aware of ?
I have an array of image width values pulled from XML. I want to simply look at the array and return a value that is equal to the highest number in the array. e.g. the array might end up like array [250,600,350,375]and I just want something that returns the highest value (in this case the 600).
way to find the highest number in an array? umbersArr(314,2613,221,103,77);is there a way to loop though this, compare all the numbers to each other and find the highest value while keeping the array in order?
I have 3 different movieclips loaded to the stage. Placed on different layers when I press the button which is associated with the right movieclip I get working only the one that sits above all. The rest is being played in the back of this movieclip.
I have 2 solutions in mind, I hope you guys could help me at leas with one of them.
-I have prepared a fade out inside each movieclip but why I am new to AS3 (I used AS2 before) I can't figure out how to trigger this when another movieclip started to play.
or
-To get the actual movieclip placed on the highest level when a button is pressed.
I want to add highest score table in my flash game ? I want to upload my game to web so visitors can play on my page and see how good they were. Im working with as2
I have a set of variables of type "integer" and I just want to take the greatest of these values, and set as the value for some new variable. How would I do this in as3?
I'm adding a custom cursor, and I need it to stay at the highest depth. Currently, whenever I add new movie clips to the screen, the custom mouse shows up behind the movie clips, which looks terrible. I have to add movie clips regularly during runtime, but I need the custom cursor to stay above them, just like the regular mouse would.
Here's how I'm adding the custom cursor:
Mouse.hide(); var cross= new crosshairs(); this.addChild(cross); cross.depth = 999999; cross.startDrag(true);
I recently downloaded an example of a xml slideshow from here
However I am having the hardest time trying to put another layer with an image, like a border over the slideshow. I have scoured google for solutions however anything actionscript i throw in to try and get the added layer to have the highest depth just does'nt work.
Code: function getHighestWidth():void{ for (var i:int = 0; i < myXML.video_title.length(); i++) { trace(String(myXML.video_title[i]).length); } }
output gives like:
22 43 54
[code].....
I could push these numbers into array and then sort that array numeric to get the highest number, but is there an even shorter way to return the highest number from these strings?
I'm adding a custom cursor, and I need it to stay at the highest depth. Currently, whenever I add new movie clips to the screen, the custom mouse shows up behind the movie clips, which looks terrible. I have to add movie clips regularly during runtime, but I need the custom cursor to stay above them, just like the regular mouse would.[code]...
I'm not sure how I would bring my buttons to the highest depth. I just finished the Kirupa slideshow, but the only prob is that the pics keep hiding my buttons.
I have a number of boxes on screen - each box is a rectangular movieclip, and they fall to the bottom of the screen where they pile up to make a stack of boxes. I'm using box2d for the physics. Oh, and each box may be rotated. I need to find the highest point - ie the smallest y value, of the stack of boxes.
Obviously I can find the position of the highest box's registration point easily (which is the centre of each box) - but that may not be the highest point of the pile of boxes. The highest point may not even be the highest box - it could be a lower box that is rotated on end, for example.
I have a ranking system set up, and its functional. The movie clips "a"-"d" displays the rank. While the dynamic text box "one" is changing for future reference.
However, I realized that if you got a rank of B, and you replayed the level, and your rank went down, you'd want your better rank to stay in place. So how can I keep the highest rank in the dynamic text box "one", so it doesn't change if you later get a lower rank?
I am creating website for our company which uses intranet. We require the best quality website with high resolution pics. When I published it using FLASH CS4. It looks like low quality pics & even the whole .swf file looks low quality movie.
I'm making an interactive map of the U.S. The layer with the outlines of the U.S. states sits on top. It has to sit on top because otherwise the outlines don't show up above the color fills for each state. I want a popup balloon to appear when you roll over each U.S. state. However, when I turn a state, say, New York, into a button, the button layer sits below the outline layer. So when I create the popup box for the button's rollover state, the popup box is *under* the US state outlines. How can I make the button rollover state exist on the highest layer?
I'd like to get your thoughts on the best way to deliver full-browser (scale to the size of the browser window) video. I'm skilled in the creation of the content but learning to make the most out of Flash CS5 and would love to hear what you would suggest.Most of the tutorials I can find on full browser/scalable video are for earlier versions of Flash; what is the best practice today? Best resolution/format for the video? If there is an Adobe guide to this I'm happy to eat humble pie if someone can redirect me to it; I'm using CS5 Production Premium.I like the full screen video effect they have on the "Sounds of pertussis" web-site;