Wednesday, 24 April 2013

WEEK 10:The similarities & differences of ASP and PHP

ASP (Active server pages) and PHP (Hypertext preprocessor) are both programming languages.



PHP is capable of being installed quickly and easily with many tools server side which can include image manipulation, uploading, email systems and much more.  ASP is designed to require registration of components and modules to make each tool possible.  ASP will usually require paying for each component upgrade as well.

ASP tends to be slower and can handle a low amount of requests before accessibility starts to lag and become labored on the server.  PHP tends to be much faster and can handle thousands of requests before strain begins to become an issue.  
When connecting to a database, ASP will tend to work better with SQL Servers and Access.  Although it is capable of running MySQL, it is more difficult to get working on just any server.  PHP has better accessibility to MySQL and other options for database connectivity.
If the server is Microsoft based, then the use of ASP with options such as SQL Server should be considered.  On the other hand, if the server is Linux, BSD, or any form of Unix, then the use of a PHP and MySQL configuration is best suited.
When using ASP it is important to remember that costs behind hosting and all components that are needed can be exceedingly high for most budgets.  PHP is much more versatile in terms of budget constraints and has a variety of free and opened sourced tools available for use alongside the commercial products as well.  Whatever the case is for power and function, both ASP and PHP can perform well under their optimal configurations with a server.

Thursday, 4 April 2013

WEEK 8: Drag & Drop Activity

Saya dtg lambat utk kelas petang tadi huhu.. Nasib baik pengetua bagi keluar meeting awal sket, kalau x maybe x dpt la nak men'drag & drop'..tq so much Pn. Sallina.. tq jugak pada Dr. Zaida yg x denda saya sbb dtg lewat hehe..sebab kan dah lewat tadi, so parking pon sesuka hati..maka dapat la saya surat cinta yg terselit cantik kat wiper kereta huk3


So sorry =( ..my mistake huhu.. 
Orait, kelas arini still discuss pasal drag & drop tapi advance sket la compare dgn yang ada dalam apps4 before ni.. Lets check this out =)

1. First, create a movie symbol. Go to 'insert', 'new symbol' and select 'movie clip'.
2. Draw a rectangle in the first frame and insert stop actionscript on the frame.
3. Insert a new keyframe in frame 2 and add stop actionscript on that frame. Put the red line for the correct respon as follows:

4. Go back to scene 1, insert a new layer and name it as 'response'. Drag the rectangle into the stage and name the instance box as box1. Drag the same rectangle again to the stage and name the instance name as 'box2'.
5. Insert a new layer and draw/import images in the same layer and convert the images to 'movie clip' symbol.
6. Insert a new layer and insert stop actionscript.


7. Now, click on the cat symbol and insert the actionscript as below:

on(press){
startDrag(this);
}
on(release){
stopDrag();
if ((this._x>=256.1)&(this._x<=429.9)&(this._y>=245.3)&(this._y<=273.9)){
_root.box2.gotoAndStop(2);
}else{
_root.box2.gotoAndStop(1);
this._x=132.1;
this._y=120.0;
}
}

[x and y values depend on the coordinate of your rectangles' position]


8. Next, click on the flower symbol and insert the actionscript as below:

on(press){
startDrag(this);
}
on(release){
stopDrag();
if ((this._x>=55.4)&(this._x<=225.3)&(this._y>=239.3)&(this._y<=273.9)){
_root.box1.gotoAndStop(2);
}else{
_root.box1.gotoAndStop(1);
this._x=384.9;
this._y=115.9;
}
}

9. For the 'next' button, insert the following actionscript to load your .swf movie into flash.

on(release) {loadMovieNum("video.swf",0);
}


But for my 'next' button, I want it to link to my previous drag & drop movie flash that I already uploaded in SwfCabin.

on(release) {
                getURL("http://www.swfcabin.com/swf-files/1364913896.swf");
          }

10. Save your file and test the movie. Try it yourself ok!

Try to drag and drop here. =D

Tuesday, 2 April 2013

WEEK 7 : Types of Interaction

TASK 1: CREATE MCQ

1. Typing the questions as static text.
2. Insert a new layer and named it as 'buttons', create a buttons using oval tool for A, B, C and D options.
3. Insert a new layer and named it as 'respon'. Put a dynamic text on the stage and named the variable as 'respon'.
4. Insert a new layer and rename it as action, right click on it and type the action script:

stop( );
var respon;
respon = " "


5. Right click on the right answer button and type the action script:

on(release){
respon = "Congratulation, your answer is correct!";
}
The example if the user click on A button =)
6. Right click on the other three button of the wrong answer and type the action script:

on(release){
respon = "Your answer is incorrect.";
}
The example when the user click on the wrong answer
http://www.swfcabin.com/swf-files/1364913397.swf


TASK 2: TEXT ENTRY QUESTIONS

1. Set the background of the questions and name the layer as background.
2. Insert a new layer and name it as question and write the question as a static text.
3. Create a rectangle on the stage. Put the 'input text' on the rectangle. Type in 'answer' for it variable.
4. Put the 'dynamic text' as a respond to user's answer. Type in 'respon' for it variable
5. Insert a new layer and name it as 'button'. Choose 'play button' from the library.
6. Insert a new layer and name it as 'stop'. Right click on the frame 1 and insert the action script:
         stop( );
         var answer;
         answer =" "
         respon = " "


7. Right click on the play button and insert the action script:


       on(release){ if(answer =="print client") {respon="Correct!";
       } else {
         respon ="Your answer "+answer+" is incorrect.";
         }
         }

         on(release,keyPress"<Enter>"){if(answer=="print client"){respon="Correct!";
       } else {

        respon ="Your answer "+answer+" is incorrect.";

         }

        }
The example when the user key in the correct answer.. =)
The example when the user key in the wrong answer.. =( hehe
http://www.swfcabin.com/swf-files/1364913761.swf


TASK 3: CREATING MAIN MENU


We will learn on how to navigate the button to other pages or website..


1. In my previous entry, I already explain on how to create a button symbol. Lets say we have a homepage like the following;


2. We need to name the 'instance name' for example 'home', 'news' and 'about' for the buttons.
3. Click on 'Window', go to 'other panel' ans go to 'scene'. Duplicate the scene 1 and rename it as scene 2.
4. Right click on frame 1 of button layer, go to 'Action' and type "stop ();".
5. Insert frame by right click on frame 15, and 'Insert frame' for every layer in scene 1 and scene 2.
6. Add a new layer to scene 2 and rename it as 'news'. Rename the 'frame label' too as 'newspage'.
7. Insert a new layer in scene 2 and name it as 'stop' and go to 'Action' and type "stop ();"
8. Right click on news button in scene 1, go to 'Action' and type:

  on (release){
     gotoAndPlay ("Scene 2", 1);
                     }  

9. So now, your news button link to scene 2.

10. Go to scene 2, right click on home button go to 'Action' and type:


 on(release){
      gotoAndStop ("Scene 1", 1);
              }

11. We add 'Latest news' button on scene 2, insert keyframe on frame 10 of news layer, named it as 'latestNews' on frame label, and type the text on stage. Dont forget to put the instance name of the latest  news button as 'latestButton'.
12. Right click on latest news button, go to 'Actions' and type:

on(release){
gotoAndStop ("Scene 2", "lastestNews");
}

13. Go to scene 1, right click on about button, go to 'Actions' and type:

on(release) {
         
          getURL("http://www.one-school.net/");
          }
TASK 4 : DRAG AND DROP

1. Type the static text on the stage as the question or direction.
2. Insert a new layer and draw / import the tree image. Convert it to 'graphic' type.
3. Repeat the same step for the apple image. Convert it to 'movie clip' type.
4. Right click on the apple and insert the action script:

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

5. Copy and paste the apple in the stage.

Now you can drag the apples to the tree!!! =)
http://www.swfcabin.com/swf-files/1364913896.swf


Alhamdulillah.. at last I've completed the task given..Many things dat I've learned thru the activities, sometimes I'm getting down because I tried so many times but still the application is not functioning well, but failure is not the end...there are no shortcuts to the way of success.. Impossible is just a big word.. Believe in yourself ok!! =) HAPPY TRYING!!

See you in the next entry..daaaa