Pages

Ads 468x60px

Thursday, May 17, 2012

Week 13 : Apps 4 on i Pad

بسم الله الرحمن الرحيم

Today we learnt how to develop a kind of interactive question using flash. We learn trough Apps 4. In this apps we have exposed how to create multiple choices question, text entry question and drag and drop application. It's interesting and fun!

Here is swf file


Multiple Choice Exercise

How to do?
  1. Create new flash file, save as mcq.fla.
  2. Insert layers for question, answer, action, respons and button.
  3. At the question's layer, create a question using static text.
  4. At the answer's layer, create an answer choices using static text.
  5. At the respons's layer, insert dynamic text for the respons of the user's answer. Set the var as respon at the properties.
  6. At the action's layer insert action script : stop(); var respon; respon = ""
  7. At the button's layer create an oval. Convert to symbol by right click>convert to symbol or F8. Select button symbol.
  8. Double click the button symbol to set the button properties.
  9. Behind of the right answer button, insert action script : on (release) { respon = "your answer is correct"; }.
  10. Behind of the wrong answer button, insert action script : on (release) { respon = "your answer is incorrect"; }
  11. Make sure untick the autokern.


How to do text entry question?

 1) Create new flash file, save asanswerquestion.fla with 6 layers wich is background, question, answer, respon, action and button.

2) At question's layer, put in the questions that you want to test the student. Remember, these text questions are of static text type.

3) At the answer layer, create the space for input text from the user using input text.
    Set the properties:
    - Embed -> all
    - Auto kern -> off (untick)
    - Options : Variable -> answer (this input text is defined as answer variable)

4) At the button layer. 
    Go to Windows --> Common Libraries --> Buttons
    Drag the button on to the stage.
5) Behind the button, create the action script.  Take note that the correct answer for this question is "oxygen".  All other answers will be taken as incorrect answer.
    The response will come out whenever the user press on the button or <Enter> button.

 on (release) { if (answer == "oxygen") {response = "Congratulations! Your answer is correct!";
   } else {
   response = "Incorrect. Your answer "+ answer +" is incorrect. Please try again.";
  }
  }
  on (release, keyPress "<Enter>") {
  if (answer == "oxygen") {response = "Congratulations! Your answer is correct!";
  } else {
  response = "Incorrect. Your answer "+ answer +" is incorrect. Please try again.";
  }
  }
6) At response layer, just create the dynamic text that will be labeled as response below the questions.
    Set the properties:
    - Embed -> all
    - Auto kern -> off (untick)
    - Options : Variable -> response (this dynamic text is defined as response variable)
 
7) At action layer, insert action script in the first frame of this layer, that is to stop the application, to define the answer and response variable, and to initialize the answer and response variable.
  stop();
  var answer;
  var response;
  answer =""
  response =""



Version 1.0

How to do drag and drop application?
1) Create new flash file, save as appledrag.fla with 3 layers wich is Layer 1 - tree, Layer 2 - apples, Layer 3 - instruction.
2) At the tree's layer, draw the tree on the stage. Convert to graphic symbol.

2) At the apples's layer draw the apple and convert to movie symbol. Duplicate the apple.
3) Put Action Script behind each apple..

 on(press){
 startDrag(this, true);
}
on(release){
 stopDrag();
}
6) At the instruction's layer, put the instruction on the scene using static text.
Ctrl + enter.. See what happened with my apples? It's can't drag and drop properly.. Why???? It's because when i convert the apple into movie symbol, the registration properties should be select on the center. In this case, i've selected on up left registration.

Drag n drop version 2.0
How to do?
1) Create new flash file, save as basketballdrag.fla with ball layer.
2) Import basketball image on the stage.

2) Select the ball and break a part. I use pencil tool to break a part the ball into 4 part. Convert to movie symbol each part of the balls.
3) Put Action Script behind each ball's part..

 on(press){
 startDrag(this, true);
}
on(release){
 stopDrag();
}

Now test the movie by click ctrl+enter.

0 comments:

Post a Comment