Pages

Friday, April 19, 2013

ASP vs PHP



What is ASP and PHP?
ASP is stand for Active Sever Pages while PHP is Hypertext Preprocessor
There are a lot of differences between ASP and PHP.
Cost
To run ASP programs one needs IIS installed on a Windows platform server, which is not free. PHP programs run on Linux, which is free. Even the connectivity of the database is expensive in the case of ASP as MS-SQL is a product of Microsoft that needs to be purchased. PHP generally uses MySQL, which is freely available.
Speed
If we compare the speed of ASP and PHP then PHP has an upper hand. PHP code runs faster than ASP. ASP is built on COM based architecture, which is an overhead for the server whereas PHP code runs in its own memory space.
Platform Compatibility
PHP programs can run on various platforms like Linux, Unix, Windows and Solaris whereas ASP is mainly associated with Windows platforms. However, ASP can run on a Linux platform with ASP-Apache installed on the server.
Additional Costs
Many of the tools used in PHP are free of cost and since PHP is open source a lot of code can be found in open source forums. PHP has inbuilt features like ftp, email from a web page or even encryption mechanisms but in ASP such features are not built in and some additional components are required. Therefore an additional cost is incurred for such components.
Base Language
PHP is based on C++ language and the syntax used in PHP is quite similar to C/C++. C/C++ is still considered the best programming language by many programmers and people who love this language would surely feel more comfortable with the syntax of PHP. ASP on the other hand has a more Visual Basic kind of syntax that again is closely related to only Microsoft products. So, it depends on a person-to-person which language he or she is comfortable
Database Connectivity
PHP, being extremely flexible, can connect to various databases, the most popular being MySQL. ASP mainly uses MS-SQL.
Source: Here

Thursday, April 4, 2013

Learning Activity 4

Learning Activity 4 : Types of Interaction

Apa itu types of interaction? Selalunya interaction ini kita guna untuk buat aktiviti seperti tutorial, latihan dan soalan2 yang memerlukan user untuk menjawab. Sebenarnya aktiviti ini merupakan cara yang paling sesuai untuk mendapat feedback atau maklum balas terhadap kefahaman atau respon kepada ape yang kita paparkan. 

Untuk aktiviti kali ini saya akan buat aplikasi yang melibatkan user menjawab multiple choice question, input question, create interface menu dan Drag & Drop.

Question 1: Multiple Choice Question




Step for create MCQ:


  1. Name layer as Question.
  2. Choose text tool > choose static text > start typing the question
  3. Insert new layer > name layer as buttons
  4. Create button using oval tool >drag it on stage >choose appropriate color-->resize the button
  5. Choose text tool > Put 'A' on top of the button
  6. Select whole button > click modify > convert it to symbol > name the button as button A > choose button type > OK
  7. Same goes to others 3 button (buttonB,buttonC,buttonD) > choose appropriate color and resize each button (same size as buttonA) > convert all the buttons to symbol and choose button type.
  8. Insert new layer > name as respon.
  9. Choose text tool > choose dynamic text > put respon as it variable
  10. Insert another layer > name as action > put action script by right click and choose actions.The action script:
stop();
var respon;
respon = " "

    11. Since the answer is C > right click > choose actions > type in the action script below:

The action  script:
on(release){
respon = "Congrats your answer is correct!";
}

    12. Do the same step for buttonA,B and D (repeat right click > choose actions > type in the action script > just edit the respon according what you want it to be.
    13. Control > test movie > done.

Question 2: Input Question



Steps to create input text question:
  1. Create layer as Background and design your background by follow your desire.
  2. Create another layer as Question and type your question here.
  3. In this layer, draw a rectangle and name as input text (this is where you type the answer), there are properties you must set, at variable box, please name it as 'Answer'.
  4. Create dynamic text below the input text, here is to put the result after your type the answer. Variable must be name as 'respon'
  5. Create your play button and put below action script;
on(release) { if (answer == "usb port") {respon = "Correct!";
}

 else
 {
respon = "Incorrect!. Your answer "+answer+" is incorrect." ;
}
}
on(release, keyPress "") { if(answer == "usb port"){respon = "Correct!";
} else {
respon = "Incorrect!. Your answer "+answer+" is incorrect." ;
}
}

Now play your movie (Control>Test Movie)

Question 3: Menu




Steps to create menu:

What we want to create.
  • A button that navigate from 1 page to another.
  • A button that navigate from 1 scene to particular frame of different scene.
  • A button that navigate users to other webpage.
Scene 1
  1. Create the background layer and design the background.
  2. Create layer stop and write below action script;
stop();
   3. Create new layer and name it as button layer. Here you need to create 3 different buttons that are have different functions.
  • Home - Is the home button after we jump to another scene.
  • Setting - this button will jump to another scene.
Setting - Action script:
on(release){
gotoAndPlay ("Scene 2",1);
}

  • Play Games - this button will jump to the website.
Play Games - Action Script:
on(release){
getURL ("http://marvelkids.marvel.com/games/play/78/ultimate_spider-man_iron_spider");
}



Scene 2
  1. Duplicate Scene 1 to Scene 2 (Windows > Other Panel > Scene)
  2. Test the movie. Here we can see that the description that we create are keep repeating non-stop. Hence, we insert action script at the button frame. 
Action script :
stop ();


3. Remove other button from Scene 1 and left 2 buttons (Setting Button and Home Button) to navigate to Scene 1.
  • Home Button - action script
on (release){
gotoAndStop ("Scene 1",1);
}

4. Create another layer and name it as button layer and create/name it as Choose Player button. Type below action script:
on (release){
gotoAndStop ("Scene 2", "choosePlayer");
}
Scene 2 is scene and choose player is frame number/name

5. At layer setting, insert a keyframe at frame no 7. Label the first frame with settingPage while the second frame name it as choosePlayer


Now play your movie (Control>Test Movie)



Question 4: Drag & Drop




  1. It is simple application.
  2. You need to create tree in tree layer, apple fruit is place on apple layer, and type the instruction by using static text on background layer. 
  3. That's three pieces of apple is a symbol in the form of movie clip.
  4.  Just click on the apple tu, enter this script action to all apple,
on(press) {
startDrag(this,true);
}
on(release){
stopDrag ();
}