Skip to main content
Inspiring
June 15, 2012
Question

How to load data dynamically in as3 ?

  • June 15, 2012
  • 1 reply
  • 1047 views

Hi,

I'm working on a project. I want to add some interactivity after the completion of  each chapter in it. The scenario is this.

1. One out of 10 questions should be asked randomly.

2. 4 out of 10 pictures should be displayed randomly and one is the correct one.

3. If User clicks on correct image, it should display some message as correct answer or some sound can be added.

4. If user clicks on other 3 images, It should display some message as incorrect answer or some audio has to come.

Need some suggestions.

Thanks in advance.

This topic has been closed for replies.

1 reply

esdebon
Inspiring
June 15, 2012

Search about URLRequest and Loader Class

http://www.republicofcode.com/tutorials/flash/as3loader/

kumar0607Author
Inspiring
June 16, 2012

Hi,

Thanks for your swift reply. I went through the tutorial. It was good and taught me how to load data dynamically but I wanna load data dynamically + randomly. Could you suggest me something related to this?

Thanks.

Inspiring
June 16, 2012

Hi,

I sugest you one method , create one xml keep your images and question. Get the data from the xml and then  push in to one array, then you can randomize.

To load the xml http://www.republicofcode.com/tutorials/flash/as3xml/ you can refer this

to randomize http://script3.blogspot.in/2009/04/generating-random-numbers-with-out.html