Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 17:13
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash and AS 3 (Moderators: papachan, kofi addaquay)
| | |-+  Is it Possible to change the String to variable?..
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Is it Possible to change the String to variable?..  (Read 607 times)
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« on: 03/16/10, 22:16 »

Hello i have some crazy things again ehehehe, i dont know its able or not

because if we have this case u must be able want to do that.. Cheesy

Here is the problem..

I have some Questioner / Exam or whatever that containts 10 numbers, then the
optional is A,B,C, and D that make by radio button

for example

1. What do you think about Flash-DB?..
    A. Very nice website
    B. Waw thats increadible site as i know Cheesy
    C. No Comment

2. What do you think about Monster?..
    A. Scared
    B. Funny
    C. Big

and the answer of number 1 is B, and 2 is C..

the id name of radio button A in number 1 is radio1a
the id name of radio button B in number 2 is radio1b

Nah we can use the conditional /  checking like this right?..

Code:
var score:Number = 0;

if (radio1b.selected){
score+=10;
}
if (radio2c.selected){
score+=10
}

but how about 1000 numbers of examp?.. Crazy conditional we made.. Cheesy

the question are
1.  Can we make the loop that can initialize many variable for example
we have 100 variable that name var1,var2,var3,var4,...,var100
Code:
for(var i:Number = 0; i<100; i++){
if ("var"+i == "blablabla")  {                    <<<<< look at that ("var"+i) do you know what i mean?.. :O
condition
}
}

so that will initialize all off the var1,..,var100 just use that, but how?..

2. Can we trace the value of the RadioButtonGroup?..

Thank you thank you very much.. Smiley sry for the strange question, but its really some important right?.. Smiley

Logged

Huihihi~ Cheesy
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #1 on: 03/17/10, 01:45 »

if you have something bigger, you would write those into an array, marking the true one.

questionArray(
   {questionID:1,question:"what do you think about flash-db",array(
                                  {answerCode:1, answer:"nice place for flashers",right:false},{answerCode:2, answer:"best flashsite in the world", right:true},{answerCode:3,answer:"dont ask me",right:false})},
   {questionID:2, question:"... ",array(
                                  {....

Or structure you like Wink

You can create this with php at the server and send it to the client as a VO (see loading and saving tutorials - section using AMFPHP)

In this case, I woul not send 100 questions at once, but rather pages.
This way it is very responsive and easy to controll.

With amfphp you could even send the questions only, and check them at the server.
That way the right answers do not travel the web Wink

As you can see - nothing is impossible Wink
Logged

happy flashing
Cool
Ronald
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #2 on: 03/17/10, 04:26 »

Oh my god, you are really jenious Cheesy

Yes i knew AMFPHP, but i just know a bit with that, i dont know why i didnt interested with that..

I have the tutorial about that, how to use AMFPHP in blabla,

Can you make me interest about that?.. Smiley

By the way thank you very much, i will try with array with this case before.. Smiley
Logged

Huihihi~ Cheesy
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything