Blogadda

Blogadda
Visit BlogAdda.com to discover Indian blogs
Showing posts with label as3. Show all posts
Showing posts with label as3. Show all posts

Thursday, February 4, 2010

AS QUESTIONS

url loader adn url request
how to communicate a as class and a asp page and a php page on online server.
MVC framework
proxy and prototype classes and their role in mvc architecture.
resizing the nested movieclips using code
get name for the child mc using the outer mc
content loader info object
singleton
observer class
how many classes can be in one as file
how many classes shud be in one package.
how we call the library onjects of loaded swf in another as file.
how many type of classes r there related to sound.
use of sound mixer class.
how we implement scorm standards in a xml application.
dispatch events
xml socket class

Sunday, August 16, 2009

SCROM, AS3 MIX QUESTIONS

  1. How to access the CDATA tag data from xml in AS2 and AS3.
  2. What is the difference between data fetching process from xml in AS and AS3.
  3. What are the commonly used LMSs.
  4. What is the latest version of SCORM. Which LMS is using the latest version of SCORM.
  5. What are the differences between the AICC standards and SCORM standards.
  6. What are differences between scorm 1.2 and 2004.
  7. How we suggest the client to go for which version of SCORM.
  8. What is the most widely used SCORM version.
  9. What is the use of adobe presentor.
  10. How we include the WMV format video in our courses.
  11. What are the basic things which needs to be take care of when developing the CORM compliant Courses.
  12. If we want to design an SCROM compliant course in flash how we move ahead.
  13. Can we design the complete course in flash or we need some other technology or language for designing.
  14. Can we make a complete course in adobe captivate.
  15. What r basic architectures we follow in designing the e-learning courses.
  16. What is the difference between the function of scorm 1.2 and 2004.
  17. what is the use of remote client and media servers in the e-learning.

Wednesday, August 5, 2009

DTO (Data Transfer Objects)

A Data Transfer Object, or DTO is a design pattern for a very specific type of object that is used to transfer data between different parts of your application.

A DTO is just for temporarily storing information whilst it is in transit. Therefor a DTO has limited behaviour, only that of storing, retrieving, validating, and internal consistency checking of its own data. They should have no responsibility in terms of security, transaction, and business logic. This de-coupling of storage and business logic will enable us to use the same DTO in different contexts.

DTOs come in two different types: generic collections, or custom objects.

Generic Collections

Generic collections, eg. Dictionaries or Arrays, are advantageous in that you only require a single DTO for all your data transfer needs. The main disadvantage is that the client has to access fields either by position index (in the case of Arrays), or by key (in the case of Dictionaries). A further problem is that as the type of objects in a collection is unknown. In a future revision of Actionscript Arrays will be typed, which will only allow collections to store data of one type. This can lead to items being stored as a generic Object type, which can lead to subtle but fatal coding errors that cannot be detected at compile time.

The creation of a dynamic generic objects can be costly as Flash doesn’t know how much memory to allocate. By typing all your variables, Flash can then allocate the necessary memory for those variables and no more. This avoids the creation of a Hash Table and will therefor decrease memory consumption and increase performance.

Custom Objects

Creating a custom class for your DTOs provides strictly typed objects which allow for compile-time checking and support code editing features like FDTs “code assist” feature (ctrl + space). The only drawback is the creation of a large amount of DTOs that might be required for a large application.

Fields contained within a custom DTO should be of primitive/simple types eg. strings, booleans, etc. or arrays of those, and it may even contain other DTOs. As DTOs are meant to be temporary objects for transferring data, their fields should be immutable (read-only). Although this can be particularly difficult to achieve under certain circumstances.


  1. package ch.forea.exampleDTO {
  2. public class CardDTO{
  3. private var _name:String;
  4. private var _address:String;
  5. private var _phone:String;
  6. public function CardDTO(name:String, address:String, phone:String){
  7. _name = name;
  8. _address = address;
  9. _phone = phone;
  10. }
  11. public function get name():String{
  12. return _name;
  13. }
  14. public function get address():String{
  15. return _address;
  16. }
  17. public function get phone():String{
  18. return _phone;
  19. }
  20. }
  21. }


The purpose of all this is to package all required information in to one package, therefor transferring everything in one call rather than multiple calls. This method can be advantageous if the call is to a remote system, as any further calls to the DTO are made locally to the client.



http://forea.ch/blog/2008/11/14/back-to-basics-the-data-transfer-object-dto/


Tuesday, August 4, 2009

ApplicationDomain class

Using the ApplicationDomain class

Using the ApplicationDomain class

The purpose of the ApplicationDomain class is to store a table of ActionScript 3.0 definitions. All code in a SWF file is defined to exist in an application domain. You use application domains to partition classes that are in the same security domain. This allows multiple definitions of the same class to exist and also lets children reuse parent definitions.

You can use application domains when loading an external SWF file written in ActionScript 3.0 using the Loader class API. (Note that you cannot use application domains when loading an image or SWF file written in ActionScript 1.0 or ActionScript 2.0.) All ActionScript 3.0 definitions contained in the loaded class are stored in the application domain. When loading the SWF file, you can specify that the file be included in the same application domain as that of the Loader object, by setting the applicationDomain parameter of the LoaderContext object to ApplicationDomain.currentDomain. By putting the loaded SWF file in the same application domain, you can access its classes directly. This can be useful if you are loading a SWF file that contains embedded media, which you can access via their associated class names, or if you want to access the loaded SWF file's methods, as shown in the following example:

package {    

import flash.display.Loader;
import flash.display.Sprite;
import flash.events.*;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
public class ApplicationDomainExample extends Sprite {
private var ldr:Loader;
public function ApplicationDomainExample() {
ldr = new Loader();
var req:URLRequest = new URLRequest("Greeter.swf");
var ldrContext:LoaderContext = new LoaderContext(false,
ApplicationDomain.currentDomain);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
ldr.load(req, ldrContext); }
private function completeHandler(event:Event):void {
ApplicationDomain.currentDomain.getDefinition("Greeter");
var myGreeter:Greeter = Greeter(event.target.content);
var message:String = myGreeter.welcome("Tommy");
trace(message); // Hello, Tommy } } }




Using the ApplicationDomain class

Other things to keep in mind when you work with application domains include

the following:

  • All code in a SWF file is defined to exist in an application domain.
    The current domain is where your main application runs.
    The system domain contains all application domains, including the current
    domain, which means that it contains all Flash Player classes.
  • All application domains, except the system domain, have an associated parent
    domain. The parent domain for your main application's application domain is
    the system domain. Loaded classes are defined only when their parent doesn't
    already define them. You cannot override a loaded class definition with
    a newer definition.

Monday, August 3, 2009

REST parameter

ActionScript 3.0 introduces a new parameter declaration called the ... (rest) parameter. This parameter allows you to specify an array parameter that accepts any number of comma- delimited arguments.

function getItems(...rest):void
{
// ... logic goes here
}

Notice that the only parameter the getItems method is ...rest, this is a rest parameter. When creating a rest parameter you should keep the following things in mind:

  • Rest parameters are untyped. It is up to you to validate any special type requirements as you loop through the rest parameter array.
  • Rest parameters must be at the end of a method's parameters.
  • The rest parameters must have ... in front of it, but the variable name can be anything.

When you want to retrieve values out of a rest parameter you simply iterate (loop) through them like you would any other array. Here is an example:

 
function getItems(...items):void
{
var total:int = items.length;
for( var i:int = 0; i < total; i++)
{
trace("Look up item", items[i]);
}
}

getItems("testA","testB","testC", 10);

When we call the method we can pass in any number of items as
long as they are separated by a comma. Back in the getItems method we get the
total from the rest parameter just like we would an array.


http://www.linkedin.com/news?viewArticle=&articleID=55481685&gid=
113435&articleURL=http%3A%2F%2Fwww.insideria.com%2F2009%2F08%2Fas-3-
rest-parameter.html&urlhash=9xja&trk=news_discuss

Wednesday, July 29, 2009

Skinnign FLV Component

Skinning FLV Playback Custom UI components individually

The FLV Playback Custom UI components allow you to customize the appearance of the FLVPlayback controls within your FLA file and allow you to see the results when you preview your web page. These components are not designed to be scaled, however. You should edit a movie clip and its contents to be a specific size. For this reason, it is generally best to have the FLVPlayback component on the Stage at the desired size, with the scaleMode set to exactFit.

To begin, simply drag the FLV Playback Custom UI components that you want from the Components panel, place them where you want them on the Stage and give them instance names.

These components can work without any ActionScript. If you put them on the same timeline and frame as the FLVPlayback component and there is no skin set in the component, the FLVPlayback component will connect automatically to them. If you have multiple FLVPlayback components on Stage, or if the custom control and the FLVPlayback instance are not on the same Timeline, then Action is needed.

After your components are on the Stage, you edit them as you would any other symbol. After you open the components, you can see that each one is set up a little differently from the others.

Friday, July 17, 2009

More AS questions

1. How do you call a static method without using the "Class Name." method name.
2. How would the for in and for each loop give the output tracing values in object.
3. How can you add video cue-point so that u can execute any action upon or middle of video.
4. Skinning of Flv component.
5. How you load one XML and read all the attributes of a node in E4X.
6. How u deal in a situation if your team member is not good @ work.
7. How would u response to a client mail when he has just bashed your project and there is no senior member present in the office.
8. Suppose in 10 hrs of learning...2 days before delivery u come to know that. The product designed is not as per client requirement. The prototype version has many changes suggested by client. How will u deal with this situation.
10. Give example of method overloading and overriding in code.
11. How u access your linked classes to other class in shared library architecture. Syntax
12. How you handle depth in AS3.0
13. 3 ways to execute Java-script from Flash.
14. Why we should prefer FSCOMMAND than GetURL in AS2.0.
15. MVC architecture and implementation.
16. Will u do a copy paste work if required for a project
17. Differences between AS2.0 - 3.0

Thursday, July 2, 2009

Choosing Between Timer and Event.ENTER_FRAME

Choosing Between Timer and Event.ENTER_FRAME

As we’ve just seen, the Timer class and the Event.ENTER_FRAME event can both be used
to produce animation. So which one is right for your family? Here are the major factors
to consider:

1. Frame rate is subject to change

When a .swf file is loaded by another application, the frame rate of that application
might be vastly different than the .swf file’s designated frame rate, potentially
causing the .swf ’s animations to play too quickly or too slowly. The loaded
.swf file can, of course, set the frame rate, but that change in frame rate might
cause undesirable playback behavior in the parent application. The Timer class
offers some frame-rate independence (subject to the limitations discussed in the
earlier section “Frame Rate’s Effect on Timer”).

2. Using many Timer objects requires more memory

In decentralized animation management architectures, using a separate Timer to
control the animation of each object requires more memory than would be
required by the analogous Event.ENTER_FRAME implementation.

3. Using many Timer objects can cause excessive screen update requests

In decentralized animation management architectures, using a separate Timer in
conjunction with updateAfterEvent( ) to control the animation of each object
leads to multiple independent requests for screen updates, possibly leading to
performance problems.

Wednesday, June 17, 2009

FEW MORE AS QUESTIONS

Disadvantages of event dispatcher.

Linkage between components.

What are v2 components.

What are mxp and mxi file and how they r relate to swc file.

Do we have method overloading and operator overloading in flash,

Any workaround on method or class overloading.

Can we exclude our as file not to be included during the runtime or can we specify to the debugger which as file to use or not.

How garbage collector works in flash.

Can we use interfaces in flash.

How do we implement MVC pattern.

How do we use observer pattern.

How we create the custom components.

Any experience on as editor or any other IDE.

Any experience on third party compilers.

What OOPS things were not there in as2 which are added to as3.

What is delegate class.?

How we use getter and setters methods in component designing.?

How we integrate our as files with the fla file.

What is linkage.

What type of polymorphism is being supported by flash.?

Load movie and load movienum

Diff. between stage and root.

Diff. between sealed classes and dynamic classes.

Exception handling methodology in flash.

What is external interface class.

How we add the page in the printjob class.

What is the way the print job class works .

Tuesday, June 16, 2009

AS3 INTERVIEW QUESTIONS

--External Interface Class

--Diff. between Overloading and Overriding

--Can we have overloading in flash?

--Do we need to override the function in same class or the different class.?

--How we start and stop video playback?

--How we load a audio , play, pause and stop, resume etc.

--Explain the sound object and How do we use it.?

-- Explain Design Patterns.?

--Diff. between Design patterns and Frameworks.?

--Whats OOP..?-- the famous borng question ever :)

--How we implement OOP approach.?

--Is as2 OOP based.?

--Do we have packages in as2.?

--How do we can achieve flash and client side communication.?

--How to communicate between flash and javascript.?

--Do we have fscommand in as3.?

A lot of others coming soon..

Monday, June 15, 2009

Adobe Flash Collaboration Service aka Cocomo

AFCS (Adobe Flash Collaboration Service) previously known as 'Cocomo' is a Platform as a Service (PaaS) that that allows Flex developers to address a class of applications known as collaborative applications.

Collaborative Applications have progressed from a nice cool thing into serious applications. Almost all of us would have participated in an online chat or a web meeting, which allows a group of users to chat, share files, do screen sharing, take polls, ask questions and receive answers, etc. AFCS aims to lower the barrier to entry for developers to bring such collaborative features into their applications.

A developer would have general questions like:
  • Why do we need a set of components to enable collaborative features in my application?
  • It should not be that complex to build a collaborative application, right? Isn't chat and sharing some files the maximum that I would want?
  • …and many more.
Well, building collaborative applications is not as simple as it sound. If you wish to build a collaborative application - you will need to consider the following in your application:
  • Handle Audio, Video and all other forms of transcoding data
  • Ensure that your application can scale to a large number of users.
  • Enable shared state in your application and ensure that multiple users are co-coordinated with each other so maintain data integrity
  • Reuse commonly used components like chat, notes, whiteboard, etc so that you can build the applications quickly and not reinvent the wheel.
  • Handle User Management and Permissions

Courtesy-- TechRepublic!!!!!!!!!!!!!!!

Wednesday, June 3, 2009

Few More As Faqs..

What are Static variable and Static classes?

What is the difference between as2 and as3?

Explain singleton design pattern and its implementation?

What are data services?

What is flex charting and its use?

Explain the complete display list API.

What is the difference between sprite and movie clip?

Explain the procedure of handling HTML items in xml.

How can we do the video editing?

What are cue points?

How can we achieve the Database integration with Flash and Flex?

What is server side data handling?

What is Font Embedding? How to do it and why and its use.?

What are device fonts?

What are dynamic classes adn how can they useful in a real scenario?

Explain the event flow.

What is object class?

Can we call add event listener and dispatch event on object class?

Which class we need to import for event?

What is the use of weak references?

What is the garbage collection procedure in as3?

Can we overload the function of two different classes.?

Difference between target and current target?

Difference between inheritance and composition?

Explain the use of flash media server.

What is flash remoting?

What is strict mode compilation?

What is the need of interfaces?

How can we pause a running event?

Difference between == and &&?


more on the go...................... :)

Friday, May 29, 2009

Mix up questions of as3 asd Flex

Few More Mix up questions of as3 asd Flex

-What is serialization.(Java Stuff)

-What is item renderer

-What is datagrid

-What is page navigation and how to achieve this in Flex

-What is the difference between mxml and as3 page.

-What is vhbox.?

-What are layers for the integration of the flex and java componenets.

-What are different ways we can connece the java class with the flex component.

-Wht architecture we generaaly follow for the component in cs3

-Do we have multiple inheritance in as3 and java.

-Why we dont have multiple inheritance in java and as3. its disadvantage with example.

-Can we have threads in AS3.?

-How we make the components in as3.?

-Where we put the code in components.?

-Can we break the compiled clip.?

-Whats the need of forms..??


More Coming soon :)

Monday, May 18, 2009

Bunch of AS questions

  • What are modifiers
  • How to do External Communications
  • What are Preloaders
  • What are Abstract Classes
  • Can we have Flash Stage Transparent
  • Can we Resize Stage at run time
  • Can you explain the difference between SWC and SWF?
  • What are Inspectable Tags?
  • What are Shared Movie Clip Symbols?
  • What is Gradient Masking
  • How we integrate ASP with ActionScript?
  • How can we Load PDF into Flash?
  • How to Load Text File Methods?
  • Integration of PHP & Flash.
  • How to upload files and downloads.
  • Explain Static Vs Constant
  • How to prevent a class from being Inherited
  • How to attach Audio & Video in AS2.0 AS3.0
  • How to add special symbol in XML like %,$,@ etc.
  • Printing a document in AS3.0,2.0
  • ExplainSCORM & LMS
  • How to communicate Javascript to LMS
  • What isLockRoot
  • How can we make Duplicate Movie Clip in AS3.0
  • Explain Memory Management in AVM2.
  • How to maintain multiple classes application as minor changing takes long time in compilation
  • What is constructor
  • Can we make it private? What happens in that case.
  • Access Modifier for the Constructor
  • Explain Layers and Depths
  • Are Movie Clip depth +ve or -ve.
  • Remove Movie Clip Method from Stage
  • What is basic behind Local Connection.
  • What is Shared Library and Objects
  • How do we load videos and add cuepoints dynamically?
  • What is deep copy and shallow copy
  • How does garbage collection works if we invoke it from function
  • Two methods of loading swf files in AS3.0
  • Two way of communication from Javascript and Flash in AS2.0
  • How do you create SCORM compliant SCO's
  • MVC architecture and Framework
  • Is there any security error we got on IE while running a Flashfile published to HTML
  • Concept of Interface and its implementation
  • External Interface in AS2.0+3.0
  • Sending and Loading values from server side script.
  • What is difference between Get and Post methods.

Friday, May 15, 2009

Flash Test paper1


Question 1

Step1

Create an XML file having information of 5 images.

Step 2

Load each node image of the xml file on the stage in a movie clip in such a manner that image will load at the center of the stage means there will not be any effect of resizing of the stage dimension.

Step 3

Set alpha 0 to 100 when each image appears. Provide buttons (Next, Previous) for navigation.

Step 4

Display height and width of each image in a text box when image loads.

Question 2

Create two buttons label (Circle, Rectangle) on clicking of each button draw shape accordingly on mouse movement

Question 3

Create a form in flash having information field say Name, Address, and Age.

User can enter information in these fields accordingly. If user closes this SFW file and again it open last field’s value should populated automatically.

Monday, May 11, 2009

Flash Test.. Try it

Drop circles on screen

Create a SWF that:

  1. Starts with a blank screen.
  2. When the user clicks anywhere on the movieclip, a small circle appears (around 25px in diameter) at the clicked position.
  3. Each time the user clicks on the movieclip, another circle is visible.

Drag ’n Drop

Create an SWF that:

  1. Has a single square present, 50x50 pixels in size.
  2. Allows you to click and drag the square anywhere on screen.

Intermediate problems

MouseOver

Create an SWF with:

  1. Three rectangles shown on screen, filled with Red, Blue and Green colours.
  2. A textfield placed below the rectangles.
  3. Whenever you move your mouse over a rectangle, that rectangle’s colour is displayed in the textfield.

Drawing

Create a SWF that:

  1. Allows you to click-and-draw lines on-screen. Just straight lines, by clicking anywhere, dragging your mouse cursor, and releasing it. The line should start from the point where you clicked on and end at the point where you release the mouse cursor.
  2. The colour of the lines you want to draw next can be changes using a ColorPicker.
  3. Has a ‘Clear’ button. On click of this button, any lines on screen are removed, and you again have a blank slate to work with.

Advanced problems

External Image Viewer

Create an SWF that:

  1. Has a textfield where the user can input an image URL.
  2. A button labelled ‘show image’, on click of which the image referenced by the URL is loaded in an UILoader present on screen.
  3. The user can pan the image (either using mouse drag or scrollbars) if it is too large to view.

Tuesday, May 5, 2009

Folder Creation-- Flash-- Not Possible

W can not make the folders or write any thing on our local using flash except for the shared object..

We can use third party tools like Zinc for that..

We can also use AIR for making that but these all are for desktop application.

web application cant do it ..

in Zinc we use it like this


working_folderLis.click = function (eventObject)
{
myfolder_br = mdm.Dialogs.BrowseFolder.show(
);
if (myfolder_br != "false")
{
working_folder.text = myfolder_br;
modules_combo.removeAll();
pageList.removeAll();
blankMc.unloadMovie();
refreshTracker();
refreshGlobals();
var _loc2 = mdm.FileSystem.fileExists(
working_folder.text + "\\index_tracker.txt");
if (!_loc2)
{
mdm.FileSystem.copyFolder(mdm.
Application.path + "\\att_common", working_folder.text);
mdm.FileSystem.copyFolder(mdm.
Application.path + "\\metadata", working_folder.text);
for (var _loc1 = 0; _loc1 <>
{
mdm.FileSystem.copyFolder(mdm.
Application.path + "\\sco_elements\\" + sco_folders[_loc1], working_folder.text);
} // end of for
for (var _loc1 = 0; _loc1 <>
{
mdm.FileSystem.makeFolder(
working_folder.text + "\\" + empty_folders[_loc1]);
} // end of for
mdm.FileSystem.makeFolder(
working_folder.text + "\\att_common\\includes");
mdm.FileSystem.makeFolder(
working_folder.text + "\\att_common\\images");
mdm.FileSystem.makeFolder(
working_folder.text + "\\att_common\\html");
mdm.FileSystem.makeFolder(
working_folder.text + "\\att_common\\css");
mdm.FileSystem.makeFolder(
working_folder.text + "\\att_common\\audio");
initTracker();
disableBtns(false);
}
else
{
refreshTracker();
disableBtns(true);
} // end if
} // end else if
};
working_folder_btn.
addEventListener("click", working_folderLis);


Wednesday, April 29, 2009

AS questions-Meebo

1. How would you determine the native width and height of the image in pixels in ActionScript?

2. How would you resize the image so that it is displayed 300px high but maintains its original aspect ratio in ActionScript?

3. What is the difference between _root scope and _global scope?

4. What is the difference between _root and _level0?

5. What is the result of this chunk of code and why?

var a = 10;
eval("a = 15");
trace(a);
6. What is the difference between the onmousedown event and the onpress event on the MovieClip class?

7. What is the result of this chunk of code and why?

var o = new Object;
o.i = 6;
with(o) {
delete i;
i = 7;
}
trace(o.i);

Tuesday, April 21, 2009

DUPLICATE CLIP IN AS3

Firstly we need to create duplicate display object

duplicateDisplayObject.as

package {

import flash.display.DisplayObject;
import flash.geom.Rectangle;
import flash.system.Capabilities; // version check for scale9Grid bug

/**
* duplicateDisplayObject
* creates a duplicate of the DisplayObject passed.
* similar to duplicateMovieClip in AVM1. If using Flash 9, make sure
* you export for ActionScript the symbol you are duplicating
* @param target the display object to duplicate
* @param autoAdd if true, adds the duplicate to the display list
* in which target was located
* @return a duplicate instance of target
*/
public function duplicateDisplayObject(target:DisplayObject, autoAdd:Boolean = false):DisplayObject {
var targetClass:Class = Object(target).constructor;
var duplicate:DisplayObject = new targetClass() as DisplayObject;

// add to target parent's display list
// if autoAdd was provided as true
if (autoAdd && target.parent) {
target.parent.addChild(duplicate);
}
return duplicate;
}
}


doubleRed.as class

package {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.geom.ColorTransform;
import flash.display.MovieClip;


public class doubleRed extends Sprite{
public function doubleRed()
{
graphics.beginFill(0x00ff00);
graphics.drawCircle(50,50,15);
graphics.endFill();
}
}
}


After it we just need to make a document class and its done!!!!!!!!!!!!

Saturday, April 18, 2009

Need of Interfaces

Interfaces are used to encode similarities which classes of various types share, but do not necessarily constitute a class relationship. For instance, a human and a parrot can both whistle. However, it would not make sense to represent Humans and Parrots as subclasses of a Whistler class. Rather they would most likely be subclasses of an Animal class (likely with intermediate classes), but both would implement the Whistler interface.

Another use of interfaces is being able to use an object without knowing its type of class, but rather only that it implements a certain interface. For instance, if one were annoyed by a whistling noise, one may not know whether it is a human or a parrot, because all that could be determined is that a whistler is whistling. In a more practical example, a sorting algorithm may expect an object of type Comparable. Thus, it knows that the object's type can somehow be sorted, but it is irrelevant what the type of the object is. The call whistler.whistle() will call the implemented method whistle of object whistler no matter what class it has, provided it implements Whistler.