ActionScript 2.0 :: Multiple Variables (concatenate With Delimiter)?

Mar 30, 2011

The course contain ten chapters that all have to report that when a user completed them. When they all are, the status is set
to "completed" for the course. First off the theory behind it:

1. I just completed a chapter.

2. Load a string with then numbers "0,0,0,0,0,0,0,0,0,0", one for each chapter. All 0's, no chapter is completed, all 1's, all chapters are completed, you get the picture.

3. Add a 1 for, lets say chapter 5, would look like this "0,0,0,0,1,0,0,0,0,0".

4. Check if the course is complete, like this: "1,1,1,1,1,1,1,1,1,1", or not.

5. If complete, set status to "complete", if not, set to "incomplete".

In practice:

import flash.external,*;
String(ExternalInterface.call("LMSGetValue, "cmi.suspend_data, TheCourseStatus"));
String(ExternalInterface.call("LMSSetValue, //..add the number "1" to

[code]....

So, after this rant. How do I,

1. Get the string.

2. Add the course number/value to the string

3. Then update the string, and..

4. ..set the appropriate status.

I found out that "I need to concatenate them together with a delimiter so I can separate the string on re-entry", but I don't know how to do that.

View 0 Replies


Similar Posts:


Actionscript 3 :: Concatenate Variables For Flash?

Apr 6, 2011

I'm trying to make a function which ideally you tell it to go to the next level and it sorts everything out to transition to the next level for you. Currently I use this to get from level 1 to 2...

[Code]....

Also I need to make it so it checks if levelText == whatever on press of the Enter key, as well as the mouse click on GoButton.

View 2 Replies

ActionScript 2.0 :: Add Array Variables Instead Of Concatenate

May 26, 2010

I have this code to push "Variable1" in to MyArray:
ActionScript Code:
_root.MyArray.push(Variable1);
Note:
"Variable1" is a number stored as a string.
When "Variable1" changes, the code above is called upon to add the new "Variable1" value in to MyArray. Then I have this code which is called upon to find the sum of all the values within "MyArray":

ActionScript Code:
for (i=0; i<=_root.MyArray.length-1; i++) {
_root.MyArray_Total = _root.MyArray_Total + MyArray[i];
}

My problem is that rather than adding the values contained within MyArray (as if they were numbers), the values are being concatenated instead.

Example:
If MyArray values were 1, 2, 3
I want the MyArray_Total to = 5
But instead... MyArray_Total = 123

I tried making a new variable named "Variable1_num", declaring it as a number, making it equal to "Variable1", and then pushing "Variable1_num" in to "MyArray"... but that didnt seem to work either.

View 1 Replies

ActionScript 2.0 :: Concatenate Variables Onto Movieclip Names?

Jun 29, 2008

var c = mainSubThumbs.SubThumbsHolder[materialType].subthumb_mc[id] what i have obviously doesnt work. materialType and id are my variables that I want to be added onto these mc instances..

View 9 Replies

ActionScript 2.0 :: Assign Multiple Variables, And Check Multiple Variables?

Oct 6, 2011

I just want to know if there is a way to assign multiple variables, and if there is a way to check multiple variables.

I want to be able to assign variables to false and then check if all the variables are false.

View 1 Replies

AS3 :: IDE - How To Concatenate Variable Names

Nov 24, 2007

How do I concatenate variable names in AS3?Something like this:

for(var i:int=0 ; i<5 ; i++) {
var "myVar"+i:Array = new Array();
}

View 5 Replies

ActionScript 3.0 :: Get Text To Concatenate Properly?

Nov 25, 2008

When I use the code below the "!" never appears in the output text field. I tried removing nameInput.text and then the "!" will appear. But with nameInput.text in the code, any string I try to add after it does not appear.

View 3 Replies

ActionScript 1/2 :: Preventing Concatenate Using '+' Operator

May 27, 2009

How can I prevent concatenating when using the addition operator? totalCost_txt.text = (firstCost_txt.text + secondCost_txt.text)I can replace the "+" with any other operator and it works. (huh?)

View 3 Replies

ActionScript 3.0 :: Concatenate Dynamic Variable?

Dec 23, 2009

I'm starting out with AS3 and migrating some old code. I have several dynamic variables in AS2 but they are using _root which isnt available in AS3.How would I go about switching the following variable to AS3? I have at least a dozen different variables similar to this one.

Code:
for (i = 0; i < (k-1); i++) {
pivot = _root["AI"+i][i][i]; // existing AS2 code

[code]......

View 3 Replies

ActionScript 2.0 :: Concatenate A Name And Variable Number?

Nov 20, 2007

I'm trying to concatenate a name and variable number. Then trace it, so answer3 should output from my loaded xml data "water". Instead all I can get to trace is the word "answer3". If I type "answer3" in the trace I get the variable im looking for. If I type [this.getCorrectAnswerNumber()] in the trace I get number 3. How do I go about concatinating the word answer and a dynamic number.

Heres my code...

Code:
trace("answer"+[this.getCorrectAnswerNumber()]);

View 7 Replies

Actionscript 3 :: Concatenate Arrays When Using Different Image Files?

Dec 6, 2011

It is possible to reference an array inside of an image file name, here's the scenario.

I have a list of images that only differ by the number at the end of the name (for example. orangeimg1.jpg, appleimg2.jpg, strawberryim3.jpg, etc. Is it possible when referencing the image that I could somehow reference the array in the file name rather than repeating the same code over and over again?

I have two different arrays set up one for fruit which has (orange, apple, stawberry) and I have another array with the numbers (1, 2, 3). I have jpg images for each of these combinations but how to I reference that in one line when I'm trying to refer to these images. I thought something like source = "[fruit].img.[number].jpg" would work

Again I've found some information on the web but it doesn't refer to how it would work if I was coding a source for my images.

View 2 Replies

Concatenate A Word With DIFFERENT Font In Dynamic Text Field?

Sep 19, 2010

I have a submit button that I'm pulling in from XML.

It needs to be XML because it is translated.

Therefore... the length is varying depending on the language.

I simply want to add an arrow to the end of the word using Webdings #4 (it looks like a solid arrow, not like > but solid)..

View 2 Replies

Flex :: Transform A String In Function And Concatenate With An Object?

Mar 2, 2010

I have the following code in actionscript 3:

var async:AsyncToken;
async = bridge.retornamenu();

The bridge is a remote object, instantiated. The retornamenu() is the function that I want the remote object open in amfphp.

However the retornamenu() is a dynamic function, which turns another function, but I can not run it at runtime,

example

var stringfunction:String = "retornamenu()" // this name is dynamic.
var async:AsyncToken;
async = bridge.stringfunction;

But this way does not work, not perform the function retornamenu();

View 1 Replies

ActionScript 2.0 :: Concatenate Two Strings As A Condition In A Case Statement?

Jun 14, 2010

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]......

View 0 Replies

ActionScript 3.0 :: Possible To Concatenate A Word With DIFFERENT Font In Dynamic Text Field?

Sep 19, 2010

I have a submit button that I'm pulling in from XML.It needs to be XML because it is translated.Therefore... the length is varying depending on the language.I simply want to add an arrow to the end of the word using Webdings #4 (it looks like a solid arrow, not like > but solid)...

View 4 Replies

ActionScript 3.0 :: Concatenate A Word With DIFFERENT Font In Dynamic Text Field?

Sep 19, 2010

I have a submit button that I'm pulling in from XML.

It needs to be XML because it is translated.

Therefore... the length is varying depending on the language.

I simply want to add an arrow to the end of the word using Webdings #4 (it looks like a solid arrow, not like > but solid)...

View 1 Replies

ActionScript 3.0 :: Multiple Variables In A For Statement?

May 7, 2009

I'm trying to declare a few variables in a for statement using the variable in the for statement. In older flash versions I would use something like this.

Code:
for(a=0;a<10;a++) {
_root["variable"+a] = "Some text "+a;

[code].....

View 3 Replies

ActionScript 3.0 :: Declaring Multiple Variables?

Dec 21, 2011

I want to declare on multiple numerated variables like this:
 
var myVar1;
var myVar2;
 
But I don't want to do this manually for every variable instance but automatically, so I need a way to instruct the compiler to declare by himself on every variable and to numerate them automatically.
 
So hopefully I explained myself well, I wanted to know if there is such way to do this?

View 2 Replies

ActionScript 2.0 :: Receiving Multiple Variables From PHP

Aug 4, 2009

Currently I have a simple setup which sends some data to PHP and then PHP returns a variable to flash. I have no problem tracing out the returned variable in Flash, however i'm strugling to send back more than one variable.[code]If I remove the trace and echo for fromPHP2, it's all good, however with with my second echo for fromPHP2 it just gives me back undefined:[code]It seems that fromPHP1 is basically returning both echo's.

View 1 Replies

ActionScript 3.0 :: How To Declare Multiple Variables

Apr 5, 2011

How to declare Multiple Variables?? with or without data types

View 1 Replies

ActionScript 2.0 :: Multiple Variables + Array?

Feb 21, 2006

i'm trying to trace this out - but i don't believe i have the right syntax:

trace (levelNum + "Questions" + [questionNum[currentQuestionNum]].correctAnswer);

i can trace out 'levelNum' and it traces out fine. i can trace out 'questionNum[currentQuestionNum]' and it traces out fine.basically without any variables my object array would look like this:

lvl(1 or 2)Questions[(a # here)].correctAnswer.

But my trace is not working and i'm not sure how to group that all together.

View 1 Replies

ActionScript 3.0 :: URLVariables - Multiple Variables With The Same Name?

Sep 18, 2009

I got a problem with URLVariablesprobably better to show by example

Code:
for each(var foo:String in fooArray){
variables.foo = foo;
}

this unfortunately doesn't work as intended as the old foo variable in the URLVariables get overridden each time.Thus when I output the variables as suchTried looking around the net for it but couldn't find anything. Also it seems logical enough that the variable gets overridden and I wouldn't really question it if it wasn't that ive been told the querystring should contain multiple definitions of the foo variable...

View 2 Replies

ActionScript 2.0 :: Form Variables From Multiple MCs?

Dec 9, 2009

I am using the Kirupa email form to gather some results on a form...How can I load variables from 2 different movieclips to post in the php? I tried...

_root.loadVariables("email.php","POST");
_root.myMC.loadVariables("email.php","POST");

View 1 Replies

ActionScript 3.0 :: Declare Multiple Variables?

Apr 5, 2011

How to declare Multiple Variables?? with or without data types

View 3 Replies

ActionScript 3.0 :: Return Multiple Variables From A Function?

Jul 21, 2011

As seen below, I tried to return more then one variable from a function but , I think I have some syntax problem..
 
function hesapla3(parametre1,parametre2):(Number&&Boolean) // PROBLEM IS HERE, I NEED TWO VARIABLES TO RETURN{var yenideger2:Number=new Number();var bol2:Boolean=new Boolean();yenideger2=parametre1+parametre2;if(yenideger2>80){bol2=false;}return yenideger2;return bol2;trace(yenideger2);trace(bol2);}

View 3 Replies

ActionScript 3.0 :: Multiple Variables For Event Listener?

Aug 28, 2011

I have been focusing on PHP a lot lately and just had a client that requires an MP3 player playing multiple songs so I had to whip out my rusty actionscript skills.  I have the player completed and it is working as desired.  The down side is it has multiple songs.  I am using separate functions for each song and separate event listeners.  My main question is there a way to combine these funtions into one and just use the event listener to pass another variable to the functions?  Below is a sample of one of the code for Song1.  I would like to make it so anywhere there is Song1 in the code, I can make it a variable so I can put in for example (Song2, Song3, Song4, etc.)  This way, I can have one or two functions handle all the songs instead of having to copy, paste and then find and replace.

// Song 1
var Song1:Sound = new Sound();
pbSong1.source = Song1;
//pbSong1.visible = false;
var Song1Loaded:Boolean = false;

[code].....

View 14 Replies

Flash :: Default Variables With Multiple Developers

Feb 4, 2010

This may be a weird question, but I'm wondering if there's any way to efficiently (perhaps using namespaces?) have different default variables in a class per developer in an actionscript project. I ask because we're currently working on a series of Flash games: 24 in total. Each is loaded by a shell container. The shell receives a flash var for which game to load. In our development environment (Flash/FlashDevelop), there are no flashvars, so a constant in the AS defines which game to load when there's no flashvar:

[Code]...

View 5 Replies

Flash :: Add Multiple Categories To ActionScript Variables?

Dec 12, 2011

I am a designer trying to modify some ActionScript for a web project. When defining the variables, I would like for some of them to have multiple parameters/categories[code]...

View 2 Replies

ActionScript 3.0 :: Conditional Statement For Multiple Variables

Oct 27, 2009

I have a conditional statement (if) that I am trying to use contingent on multiple variables being true. So the AS I have right now is:

[Code]...

But when I run that I get the following error message: "Error 1050: Can not assign to a non reference value" What do I need to change so that once 1,2 and 3 have been visited visitComplete is set to true?

View 3 Replies

ActionScript 3.0 :: Setting Multiple Variables Dynamically?

Nov 10, 2009

I've automated a lot of my script, but cannot automate the very beginning where one sets the variables. I have the following script that I'd like to put in a "for" loop :

private var aliPlane1:Plane3D;
private var aliPlane2:Plane3D;
private var aliPlane3:Plane3D;

[code]......

View 9 Replies







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