mardi 21 juin 2016

Save data in dynamical text in another frame while working on current frame as3

I am working on Flash actionscript 3 to create a quiz using combobox. I used the following code.

box1.addEventListener(Event.CHANGE, changeHandler);
\\box1 is combobox 1

function changeHandler(event:Event):void


if (box1.selectedIndex == 1)
\\there are two values in combobox with index 1 and 2

    name1.text = "1) Wrong";
\\name1 is the dynamical text box
else if (box1.selectedIndex == 2)
    name1.text = "1) Right";
    name1.text = "";

I put the dynamical text box on frame 4 while the combobox is in frame 2 I created two comboboxes. when I select an option from combobox 1, I get an error like this: Error #1009: Cannot access a property or method of a null object reference.

So I extended the dynamical text layer from frame 2 to frame 4. But after running the program, the result is shown only in frame 2 immediately after selecting the value from combobox 1; so that the result is displayed before selecting combobox 2.

What I need is to save the result in frame 4 and it is displayed only when I go to that frame using next buttons.

Any help would be appreciated. I am beginner in Flash actionscript.(I prefer using interface than coding).

Aucun commentaire:

Enregistrer un commentaire