ActionScript 3.0 :: Map Choice / Scenario With Dictionary + Arrays?

Apr 22, 2011

I am trying to create a scenario type quiz. The student's choice at each question point will take them to a new part of the scenario. So I guess it's a custom story based on student choices.

Anyway, first I am trying to make an authoring tool for this that will allow the scenario creator to graphically map out the scenario. So file icons are created (each representing a step in the scenario) with a number of targets as children (representing the choices). The targets are how the author draws lines from choices to corresponding files. When you click on a target I need to record which choice that is (choice1, choice2, etc) and draw a line from there to the file which the choice must lead to I need to record the name of that file. So, I was thinking that I would use dictionaries since they can be indexed with objects. One dictionary for the files, and one dictionary for the choices in that file.

dict1 --> dict2 --> array
file --> targets --> choice number to next file correlation

But I am having the hardest time getting anything to work. Am I going down the right path or should I change my approach?

View 2 Replies


Similar Posts:


ActionScript 3.0 :: PrintJob Based On Drag And Drop Scenario On Stage

Jan 7, 2011

Does anyone have a print job script that I can use on a mouseclick over a symbol - I want to print a specific area on a stage based on a drag and drop scenario... once all the relevant_MC's have been dragged into position the person gets the option to print via a button. I've attached the SWF for a view of the end product - I only need to print the grey area in the middle - not the white (thats where the drag and drop items will sit when not in use).

View 0 Replies

ActionScript 2.0 :: Goto Frame - Start The Game It Gives A Scenario And 2 Boxes To Click?

Mar 25, 2010

I've seen various games where by when you start the game it gives you a scenario and 2 boxes to click, if you click a you go to frame say 57 and if you click b you goto frame 58

[code]...

View 1 Replies

Actionscript 3 :: Dictionary Mechanism - Dictionary Use Id To Compare If The Two Keys Are Equal, Not Use Strict Equal(===) To Compare If The Key Is The Same?

Aug 27, 2010

The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:

class Student{
var id:int;
var name:String;[code]....

I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.

View 2 Replies

Arrays :: Flash - Pushing Or Adding Arrays As Values Into A Multi-dimensional Array?

Jan 21, 2011

I am running into some trouble adding an array into another array to create a multi-dimensional array.The code appears as below:

var slideDataArray:Array = new Array();
var slideShowDataArray:Array = new Array();
slideDataArray[0] = xmlData.SlideShowParameters.SlideShowImagesDirectory;[code]........


I am looking for a means of placing the slideDataArray into a 'slot' or value of slideShowDataArray so that I can in the end pass the slideShowDataArray as a parameter to another function.As of now, the last slideDataArray appears 11 times (the loop runs 11 times) in slideShowDataArray and the way the code is written the slideDataArray is unique every iteration of the loop.

View 1 Replies

IDE :: XML Flash Quiz (Multiple Choice)

Jan 31, 2007

I have made a quiz from mixing and matching from various tutorials of the internet, and now want to make the questions (multiple choice) and possibly the answers appear shuffled. The xml looks like this:
<quiz>
<title>Quiz</title>
<items>
<item>
<question>In which continent is the country Japan located?</question>
<answer correct="y">Asia</answer>
<answer>Europe</answer>
<answer>Africa</answer>
<answer>America</answer>
</item>
and here is what I've got so far with the actionscript!

View 2 Replies

ActionScript 3.0 :: Arrays Of Arrays / Data Providers And Dictionarys

Aug 26, 2009

I've got a bit that loads a big chunk of xml data about products.I push product info into an array(e.g. productArray), then add that array to another array (e.g. allProductsArray)How do I sort those arrays? For instance, if I want to sort the allProductsArray based on the info in productArray[0]?Alternatively, would something other tha an array of arrays be a better route?This loader loads the same sort of info for many different clients, so the bit to sort on will change.

View 5 Replies

Multiple Choice Game Containing Questions And The Answers?

Apr 22, 2009

I have a project that i want to make which is a Multiple choice game containing questions and the answers is four pictures when you click on the right answer you move to next question when your are wrong a wrong sign appears i have zero knowladge about flash but i thought this is similar to Geo Challenge in facebook ,,Right ?? what software to download ? any tutorials online ?

View 4 Replies

ActionScript 3.0 :: Add Multiple Choice Answer To An Object?

Oct 18, 2009

I have declared an array which holds an object such as:

var myArr:Array = new Array({Question: 'Primary Colors Are?'});

How can I add the multiple choices to the object These are the choices:
 
red, green, blue
orange, red, white,
purple, yellow, green,
white, black, blue
 
I certainly can create the Answers as:

var myArr:Array = new Array({ Question: 'Primary Colors Are?', Answer1: 'red, green, blue',
, Answer2: 'orange, red, white, Answer3: 'purple, yellow, green', Answer4: 'white, black, blue' });

What I would like to do is to be able to store all the answer choices within an array called AnsArr. Can I declare a new array within the same obejct such as AnsArr and push these choices to it? 

View 3 Replies

ActionScript 3.0 :: Randomize Multiple Choice Buttons

Oct 26, 2009

I want to randomly scramble 4 multiple choice buttons (assigning each of them to one of four different positions). I'm trying to (a) randomly extract an element from an array, (b) delete that element from the array, and (c) go through the same process 3 more times till I have 4 random numbers assigned to 4 separate variables. I should be able to assign the buttons to different positions after that. 

Here's the first round of what could loosely be called code:

var firstElement:Number = 0;var distList:Array = ["0", "1", "2", "3"];var distNum0:Number = 0;var distNum1:Number = 0;var distNum2:Number = 0;var distNum3:Number = 0;

[Code].....

View 9 Replies

Professional :: Random Frame Choice With No Repeat?

Sep 1, 2010

I am currently working on a flash game and I only have one major problem left!  I have a series of questions that are each their own movie clip in flash.  I have 13 different questions and thus 13 different movie clips, one for each. The issue I am having is thisDuring the course of a game sometimes a question will repeat itself, and I dont want that. I have tried to make the question selection random and without repeat but have only succeeded with the random part at this point.This is my code for for frame 1:

function randFrame(cFrame){
goFrame = random(11)+2;
if (goFrame == cFrame){

[code].....

View 25 Replies

ActionScript 1/2 :: Use Button To Select Combobox Choice?

Jun 13, 2011

I have a combobox (called "style_cb") and as you might have guseed you can use it to select a "style".The site also has pictures and I'd like users to be able to click the pictures (which are buttons) and have the comboboxautomatically set to that option.So, if the options in the combo are "oranges, apples, pears, cherries" and the pictures are of the same fruits,then clicking on a picture of a fruit (let's say "cherriesBtn") would set the combo box to that option.

View 1 Replies

ActionScript 2.0 :: Simple Multi Choice MC Buttons?

Jul 7, 2011

This is part of a large quiz I am building. The three choices here are part of a group of three from which you should only choose one. If so the other two are enabled=false.I can't change the method only modify since it is part of a much larger app that is runnung fine. So no radio buttons or codeing on maintimeline.

If you run the attached simple FLA and select the first choice you can see the enabled=false that is on the voted and pass framesworks fine, however if you choose the second the first is only disabled and the third is enabled and as logic would have it if you choose the third the first and second are enabled.The idea is to make it so the user can only choose one the other two are disabled while still having the choice to deselect.

View 0 Replies

Professional :: Multiple Choice Quiz - How To Set Correct Answer

Jul 1, 2010

I'm using CS4 and trying to create a new quiz using one of the templates.I can see how to edit it to get only Multiple Choice but I'm stuck at one thing - I can't see where to specify which choice is the correct one.

View 4 Replies

ActionScript 3.0 :: Setup A Multiple Choice Radio Button?

Jul 21, 2010

I am trying to setup a multiple choice radio button question quiz, but I'm having issues with some of the AS and was hoping some of you could assist me. I'm fairly new to ActionScript, but I'm trying to pick up quickly. The code is listed below. The lines giving errors have been increased in size.

[Code]...

View 9 Replies

Professional :: Go To A Frame Based On Radio Button Choice?

Apr 24, 2011

I have created a movieclip that is simply asking a question and the user chooses from a list of Radio buttons.I have set this up and it works fine, but I cannot figure out how to set up a "Next" button or a "Submit" button that, depending on the radio button choice made, the user goes to a specific frame or label.I bought the Adobe Flash CS5 bible, but there seems to be little information on controlling Radio buttons, only how to set them up to test.

View 1 Replies

Actionscript 3 :: Stop The Tween At The Point Of Choice (first Code)?

May 12, 2011

This is for Actionscript 3.0 on CS5.I've been having some issues with fl.transitions.easing.None.easeNone. I tried to animate my MovieClip character without easing and stopping on a dime. I used the following code to stop the easing:

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(evt:KeyboardEvent):void
{

[code]....

View 3 Replies

Flash :: Change Default Choice For Autocompleted Classes?

Feb 9, 2011

Sometimes there is a name conflict between classes in two different libraries, but I almost exclusively use one over the other. Unfortunately, the one I am using is not showing up as the first entry and I have to press the down arrow to pick it.

View 1 Replies

Actionscript 3 :: Either Stop The Tween At The Point Of Choice (first Code)?

Jun 5, 2011

This is for Actionscript 3.0 on CS5.I've been having some issues with fl.transitions.easing.None.easeNone. I tried to animate my MovieClip character without easing and stopping on a dime. I used the following code to stop the easing:

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(evt:KeyboardEvent):void
{

[code].....

View 1 Replies

ActionScript 2.0 :: Simple Multi-Choice MovieClip Buttons

Feb 6, 2011

This is part of a large quiz I am building. The three choices here are part of a group of three from which you should only choose one. If so the other two are enabled=false. I can't change the method only modify since it is part of a much larger app that is runnung fine. So no radio buttons or codeing on maintimeline. If you run the attached simple FLA and select the first choice you can see the enabled=false that is on the voted and pass framesworks fine, however if you choose the second the first is only disabled and the third is enabled and as logic would have it if you choose the third the first and second are enabled. The idea is to make it so the user can only choose one the other two are disabled while still having the choice to deselect.

View 1 Replies

ActionScript 2.0 :: Synchronize Movies Depending On User Choice?

May 1, 2011

I have a flash project where I have two movies that are supposed to synchronize, depending on user choices. Most of the time they do, randomly they do not. So I thought perhaps there is something wrong with the code I am using.

Code:
on (press){
this.movie1.gotoAndPlay(random(this.movie1._totalframes));
if(this.movierandom.enabled == false){
this.movie2.gotoAndPlay(this.movie1._currentframe);
}}

What's supposed to happen is, when the button is pressed, movie1 goes to a random frame and plays. If movierandom is not enabled, movie2 is supposed to go to the same frame as movie1 and play. Movie1 and movie2 have the same number of frames. Occasionally, movie2 goes to a different frame.

View 1 Replies

Arrays :: Fastest Way To Merge Multiple Arrays?

Sep 26, 2011

I'm trying to write a function where I can specify any amount of array, and the return value will be an array containing the contents of all of the specified arrays.I've done this, but it seems like a really slow and ugly way of doing it:

var ar1:Array = [1,2,3,4,5,6,7,8,9];
var ar2:Array = ['a','b','c','d','e','f','g','h'];
function merge(...multi):Array[code].....

Is there an inbuilt and more efficient / nice way of achieving this? The result does not need to be in the same order as the input - completely unsorted is fine.

View 3 Replies

ActionScript 3.0 :: Randomizing The World! Arrays And More Arrays?

Feb 17, 2009

A little explanation: Im making a random arranging number Array. So instead of using a loop and assigning 0 to first array element, 1 to second, etc.I need to make it totally random but without repeating any numbers. To do that I made a second Array that will have the same number of children to serve as a reference.Each of them will be an Object with a property "num" , wich will be its actual number, and a property "called" wich defaults to false.Like this:

ActionScript Code:
for(var i:int=0;i<vQuantity;i++){
ranArray.push( new Object() );

[code].......

View 8 Replies

ActionScript 3.0 :: Arrays Store References Of Other Arrays?

Dec 27, 2009

I've had a problem for awhile that was really odd. After some intense debugging, I realized the problem lied in setting an array equal to another array.[code] When setting one array equal to another, the values aren't copied over, but a reference to that memory is stored. So no matter which variable you change, they are both references to the same memory and thus both will reflect the changes.With other data types, this doesn't happen.I could fix it by looping through t1 and using push() to add each index from t1 into t2, but that seems a little messy.

View 7 Replies

ActionScript 2.0 :: Pushing Variables To Arrays Within Arrays?

Jun 25, 2004

correct syntax for pushing variables to arrays within arrays? I have searched many threads but found nothing that exactly answers my query.I have a class (Brigade) which amongst other variables contains an array (BrigadeUnits) This is the third element.. My Brigades are stored in an array called AllBrigades. I now need to fill the BrigadeUnits array with objects of my Units class.The hierarchy I want to create is as follows:

AllBrigades (array of Brigades)
Brigade (object)
BrigadeUnits (array within Brigade object)
Unit (Object to be stored in BrigadeUnits array)

I have tried various approaches including the following, assuming that I am addressing the first Brigade in the array:

AllBrigades [0] [2].push (MyUnit);

But when I trace this I just get undefined.

View 14 Replies

Flash :: Viewer / User Can Watch A Video Clip Of Their Choice

Jun 25, 2009

I want to make a flash form where the viewer/user can watch a video clip of their choice (from a drop-down control or something else if there's a better way). I've found myself totally unable to find our how to do this. I mean, frankly, I don't even know what kind of file to start from the "New..." form at the beginning of Flash (CS 3.0, btw)!

I know how to create a Flash Player and link it to a single video. What I envision is that after the page comes up, with a single player component (initially empty), the user chooses a video from the drop-down list and that video starts playing in the player. What kind of file should I be starting with? {I kinda assume I'll be making an SWF to put on a web page.} Where on earth do I learn how to get the simplest things (e.g., button clicks, etc.) to work?

View 2 Replies

ActionScript 1/2 :: Survey With Several Multipule Choice Questions Using Radio Buttons?

Nov 10, 2009

I have created a survey with several multipule choice questions using radio buttons. I want the last page of the survey to display results to the user kind of like a Cosmo quiz.like "50% A." "25% B." "25% C." "0% D." I can't find any info on how to do this with Actionscript.

View 1 Replies

ActionScript 3.0 :: Multiple Choice Question Not Displaying Answer Feedback?

Jun 9, 2011

I have a few multiple choice questions using ActionScript 3.0 that are not displaying the answer feedback when tested as a movie or published to a swf. The way the question is set up is that a learner clicks a radio button and then clicks a Check Answer button. A red X or green checkmark appears next to the selected answer choice.Incorrect/Correct feedback should then appear below the Check Answer button.Currently the Incorrect/Correct answer feedback is not appearing in the output box when published.
 
stop();
 var currBtn = "";
var currSelected:Number = 0;[code].......

View 1 Replies

Actionscript :: Add Score Tracker In An If / Else Statement For Multiple Choice Game?

Dec 12, 2010

Where and how I'd put the rest for the score tracker? I'm going to be making 3 of these multiple choice questions, so what would be the best way I lay that out and transition from one question to another?[code]...

View 1 Replies

Flex :: Arraycollection - Assign An Index Of My Choice To Array Collection?

Dec 14, 2010

I want to give an array index to array collection let say 205 when it is started is it possible to do so in flex or any alternate of this.actually I need to index the objects with a specific no, in 2D array collection

say

205 a c d g f d
268 s g h g f f
805 d g h h f f d

where integers are indexes and alphabets are object referenced by these integers

View 2 Replies







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