ActionScript 2.0 :: Select Case Statement And Its Format?
Nov 27, 2002Is there such thing as a "select case" statement in actionscript? If there is what is its format?
View 2 RepliesIs there such thing as a "select case" statement in actionscript? If there is what is its format?
View 2 RepliesI am trying to get my pages through Case Statement But.
[Code]...
I'm trying to use the value from a combo box in a switch case statement but it isn't working
Code:
var switchValue:int = 0;
switchValue = int(cmbColour.selectedItem.data);
switch(switchValue) {[code]....
I've got a slider on my navigation bar that rides along with the mouse; movies play perpendicular to it as I scroll. If I click on the movie, I link out to another page (easy enough). However, the actual slider doesn't do anything more than look nice. I know that if I don't make this thing child proof, I'm going to catch grief about it. So I tried to set up a switch that links out according to range values y<0 && y>125. As it stands, I don't get any errors, it just always goes to default. I'm missing something.I could always try a gia-normous 'if' statement, but I thought that I'd give the switch a try.
View 4 RepliesI see Switch statement in:
switch() {
case 'string': ...;
}
but would hope if I could do this?
I'm trying to use switch/case staement instead of if/else but it's not working. Here's the code.
ActionScript Code:
//working code
function checkTarget(drag){[code].............
How do you do a range using switch statement in ActionScriptFor example:
score = txtScore.text
switch(score)
{
[code].....
How do you do a range using switch statement in ActionScript For example:
[Code]...
I have a large group of functions.The function to be called depends on the value of a var (which is a int);I could make a long case statement along the lines of this
PHP Code:
var Pos:int = 0;function test1():void{ trace("Test 1");}function test2():void{ trace("Test 2");}function test3():void{ trace("Test
[code]....
I am trying to figure out how to apply the is operand or the instanceof in a case statement to determine which datatype a interface object belongs too. keep getting errors
switch (IOjbect is)
{
case Tile:
[code].....
I can't for the life of me come up with anything that works...
function setCurrentCMI(id){
if (_level0.strInteraction+id==""||_level0.strInterac tion+id=="undefined") {
//does nothing, user hasn't been here yet
[code]......
I've been creating an application using the Adobe AIR Packager for iPhone (command line style).The app consists of a lot of screens that provide various information, and the navigation is handled all in the document class via an event-triggered function that uses a large switch-case statement to determine what screen to go to.
When we compiled it through the iPhone Packager and tried to test it on one of our phones, it would load up to a blank screen.
After some error testing it was revealed that the switch-case itself is causing a problem (changing it to an if-else that had the same functionality worked just fine). Does anyone know whether this is a known issue, or if something can be done to fix that other than converting it to an if-else.
How i write the inline conditional statement in Flex with two expressions(case) [code]...
Flex compiler only check the first expression and on behalf of that give result.But i want to check both statement and show result.
I have some trouble with the conversion applied by BlazeDS to the name of the properties when this name begins with a lower-case letter followed by a capital letter. I have an ActionScript class similar to this:
[Code]...
I have a comboBox and values like basic and advanced. And viewstack container conatains 2 grids.When i select the base option in Combobox, the first grid has to be selected. select the advanced value in comboBox, the second grid has to be selected.
<mx:ViewStack id="viewstack1" width="95%" height="85%" x="0" y="63" >
<tables:KeyMetricsBasicTable basicArrayDataProvider="{basicArrayResult1}" width="100%" height="100%"/>
<tables:KeyMetricsAdvTable advArrayDataProvider="{advArrayResult1}" width="100%" height="100%"/>
</mx:ViewStack>
Flex 4 Combobox is extended with a Text Input that helps in getting to the item that is searched for.I have created a Check Box as an itemrenderer for this Flex 4 Combobox. I would like to Add a Select All and Select None options in the drop down of the Combobox. I know that i could accomplish by editing the dropdownfactory in case of a Flex 3 Combobox. But in Flex 4 the dropdownfactory doesnt exist.
View 2 RepliesWhat I'm trying to do is create a program that, depending on 2 variables, multiplies another variable by a static number. Heres the code I have so far:
[Code]...
I want this on an MC:
[AS]
i = 0;
switch(thing){
case 0:
[code]....
Basically what I'm wondering is, will I lose the value of i in the first switch once I'm out of the switch? Can the second switch read the 1st switch?
Im trying to create a program that, depending on 2 variables, multiplies another variable by a static number. A friend suggested I use case/switch instead of if/else statements,which is what I was using before.
[Code]...
how to publish live video feed from webcam in h.264 format non VP6 format with FMS 3.5.2 without using Flash Media Live Encoder, and how to set all parametersto have a good quality and smooth video without interruption, i have a server with 50Mbit bandwidth output enough for a publisher and 10 clients meunderstand this thing's been months since I try but the quality ugly
View 1 RepliesHaving a few problems with what I thought was a simple if statement. Here is the code:
[Code]...
I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.
if (variable == 1){
//code
//Execute this code.
} else if (variable == 2) {
//code
[Code]...
I dont want to copy the code from the first into the second and the first and second into the third.
My mind isn't working and there is probably an extremelly simple way to get this working.
I know I could used functions but for some reason it stops the instance referencing working: _root["bullet"+j] doesnt work in a function.
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
Heres the code:
Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
[code]....
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
I want to make a textinput where a person can type in a price. I used "restrict" to only allow numbers and decimal. But the person can type in several decimals and create numbers like 11.1.1.1 or 11...11 or 1.11111
i want to restrict the entry to only one use of a decimal and only two numbers after the decimal.
any other way to format a textinput to a currency format?
I want to format a number in indian format.
for example,
x= 123456 should be formatted as 1,23,456.
How can i do it in flex?
Is there any library in Action Script that be able to convert any video format to .FLV?
I've been looking for it with no success. I thought that as3 had functions for that purposes but not found.
I want to give the possibility that in my site, users can upload any video, so I need to convert it to a standard and compress it to a fixed resolution.
why this code won't work
[Code]...
I'm sure you can put if statements inside other if statements, seriously I can't figure it out
I need to write an if statement inside an if-else statement. But no matter how I write it it keeps giving me a syntax error.The syntax error is "1083: syntax error: else is unexpected".[code]No matter how or where I place the braces, it keeps giving me errors.
View 13 Replieswhat I'm trying to do is create an else if argument for each object in an array based on a user set number
Code:
for(var i:int=0; i < numberOfElseIfs; i++){
GENERATE AS3 CODE
}
to which I want it to GENERATE THE FOLLOWING CODE:
Code:
}else if(baskets[i].used == false){
baskets[i].used = true;
drawButton(i);
}
the problem is obviously that the compiler reads this code rather than understanding I'm trying to regenerate the code within the for loop...does that make sense :S? So basically I need as3 to read the code between the for statement as if it is going to echo that out later. Is this even possible?
I have series of data which is stored in Array
eg :
Code: dateArray:Array = [["user1","1-5-2007"],["user1","13-5-2007"],["user10","21-5-2007"]];
then I loop the array to search the data I want to return to another function...my problem is how to format the date value in array to become this format before I can make a comparison with this value....
5/21/2007--> this value got from this current date
so the problem is how to convert the value in array from this format
21-5-2007 to this 5/21/2007 for all the values....the data I load from dtbase actually that's why it store that kind of format....