Sunday, December 18, 2011

More Flash Inteview Questions

Q11. Can you read a remotely placed sound file? Where will you store the location of the sound file?
Ans: Yes, the server will store the location of the sound file, and will send it to the client whenever required.

Q12. How do you use Tweening?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2011/01/tweening-part-i.html

Q13. How do you use drag and drop in action script?
Ans: The following piece of code starts the drag for myMC display object when mouse is clicked over it, and stops the drag when the mouse is released up.

    myMC.addEventListener(MouseEvent:CLICK, onMouseClick, false, 0 , true);
    myMC.addEventListener(MouseEvent:MOUSE_UP, onMouseClick, false, 0 , true);

    function onMouseClick(e:MouseEvent)
    {
        startDrag(this);
    }
   
    function onMouseUp(e:MouseEvent)
    {
        stopDrag();
    }

Q14. What is the use of preloader? How can you create one?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2011/01/creating-your-own-flash-preloader.html

Q15. What are the different design patterns available in flash?
Ans: 

    1) Factory Method Pattern
    2) Singleton Pattern
    3) Decorator Pattern
    4) Adapter Pattern
    5) Command Pattern
    6) Observer Pattern
    7) Strategy Pattern
    8) Template Method Pattern
    9) State Pattern
    10) ModelViewController Pattern
    11) Symmetric Proxy Pattern
    12) Composite pattern
   

Q16. What is the purpose of bitmap caching?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2010/12/when-does-it-make-sense-to-use-bitmap.html

Q17. Which ActionScript method should be used to bring a component from the library to the stage?
Ans: attachMovie

Q18. Describe Event Flow in flash.
Ans: The event flow is conceptually divided into three parts.
    1) Capture phase: This phase comprises all of the nodes from the Stage to the parent of the target node.
    2) Target phase: This phase consists solely of the target node.
    3) Bubbling phase: This phase comprises the nodes encountered on the return trip from the parent of the target node back to the Stage.

Q19. How do you create pop-up window in flash?
Ans: The following piece of code opens up a new window on the click of "myMC" display object.

    myMC.addEventListener(MouseEvent:CLICK, onMouseClick, false, 0 , true);

    function onMouseClick(e:MouseEvent):void {
            ExternalInterface.call("window.open", "http://bashwithflash.blogspot.com/", "win", "width=500,height=500");
        }

Q20. Explain the difference between Stream Sound and Event Sound.
Ans: Refer to the post: http://bashwithflash.blogspot.com/2010/12/sound-bound.html

Thursday, December 15, 2011

Flash Interview Questions

This post mainly deals with the most popular flash interview questions that we come across now. Hope it fulfills the purpose.

Q1. What is the default frame rate?
Ans: The default frame rate is 24 frames per second (fps) for the new versions. In previous versions of Flash, the default frame rate is 12 fps.

Q2. From which version of Adobe flash player, you see the compatibility of AS 3.0?
Ans: Flash Player Version 9

Q3. How many types of symbols can be there in any flash application? Name them.
Ans: 3, namely, Button, Movieclip and Graphic.

Q4. How does the it affect the frame rates of a swf file when it is loaded into another?
Ans: The new swf file takes the frame rate of the parent swf file and runs with that.

Q5. How can you change the frame rate with the help of code, with and without using the stage property?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2011/09/frames-and-frame-rates.html

Q6. Why do we need to embed fonts to a dynamic text field?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2010/12/dynamic-text-look-and-feel.html

Q7. How are _root and _level different?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2011/08/root-and-level.html

Q8. How are _root and parent different?
Ans: "_root" is the main timeline of the currently active movie. "parent" is the container movie of the currently active movie clip.

Q9. Write a code sample to draw line between the given two points?
Ans: We use the "lineTo(x,y)" API. Here is the example code:

    var mc:Sprite = new Sprite();
    mc.x = 50;
    mc.y = 50;
    this.addChild(mc);
    mc.graphics.lineTo(100,100);

This sample code defines a movie clip at (50,50), and draws a line from this point to (100,100). Now line is the mc. We can further draw more lines to other points also.

Q10. How do you add listener to a particular display object? What are the arguments that you need to pass to the listener?
Ans: Refer to the post: http://bashwithflash.blogspot.com/2011/01/capturing-events-in-flash-as3-part-ii.html


Apart from the above questions, OOP concepts are also asked. The candidate might also be asked to make a small flash application.

Readers are most welcome to make any correction to the answers they think is wrong. Also keep adding the questions too.

*More questions to follow soon in the next post.