Blogadda

Blogadda
Visit BlogAdda.com to discover Indian blogs

Friday, April 17, 2009

Image gallery to be made

The size of that application should be of –

  • Size of application will be : Width 341 and Height 368 pixel.
  • Big Image Size: Width 330 and Height 210 pixel.
  • Thumbnail size: Width 72 and Height 60 pixel.
  • Your browser may not support display of this image.This application will show two kinds of images, 1. Big Size Image 2. Small Thumbnails,
    according to the UI bellow.
  • Thumbnails should be in SCROLL PANE component of flash.
  • Images should be loaded from XML file or from array inside flash.
  • If you click on Thumbnail, then bigger images should be changes with fade out effect.
  • Please Use external .as files / Classes to write methods and functions related to this application.
  • Please collect 15 images from Google Images Search according to your choice.

Tuesday, April 14, 2009

One more Flast test question

Code a multiple choice multiple select interactivity based on the below mentioned requirements (Time- 2.5hrs):
  1. All the data (question text, option text, feedback and the number of attempts) should be kept and parsed through XML file.
  2. The number of option texts should be populated and placed on the stage based on the data entered in the XML file.
  3. The submit button will be enabled only when there is at least one option selected.
  4. The incorrect/partial correct feedback will be displayed for the incorrect attempt and correct feedback will be displayed for the correct attempt.
  5. The submit button will toggle to a solution button once all the incorrect attempts are over. Clicking the solution button will display the correct answer.

Sunday, April 12, 2009

FONT EMBEDDING in AS3

FONT EMBEDDING in AS3

// ActionScript 3.0

[Embed(source="assets/ARIAL.TTF", fontFamily="ArialEmbedded")]

var ArialEmbedded:Class;

var arialEmbeddedFont:Font = new ArialEmbedded();


var textFormat:TextFormat = new TextFormat();

textFormat.color = 0xFF0000;
textFormat.font = arialEmbeddedFont.fontName;

textFormat.size = 32;

var textField:TextField = new TextField();

textField.autoSize = TextFieldAutoSize.LEFT;
textField.wordWrap = true;

textField.defaultTextFormat = textFormat;
textField.embedFonts = true;

textField.text = "The quick brown fox jumps over the lazy dog.";
textField.width = 500;

textField.x = 25;
textField.y = 25;


addChild
(textField);

Monday, April 6, 2009

Memory leaks

Memory leak refers to a condition in which an incremental but steady loss of memory seems to be taking place. Usually, the root cause of memory leak has to do with the malfunction of one or more programs running on the hard drive . Essentially, the program fails to return memory to the hard drive when usage is complete and the resources are no longer needed. The result is that the used memory is not cleared for use by other computer programs, and thus diminishes the operating capacity of the computer.

Just about any type of program can be the source for memory leak. In some cases, it may be an application program, such as a database, that resides on the hard drive. At other times, the cause of the memory leak could be one of the essential program files that drive the operating system for the computer. Generally, the malfunction within the application is the result of some sort of invasion into the program proper, such as a virus or bug.

Even when the memory leak is relatively small, it can eventually cripple a system. Each time the infected application is run, the application grabs more free memory and never returns that amount of memory to the system. Over time, the amount of available memory becomes so limited that other applications are unable to obtain resources to launch or perform necessary functions, and begin to become inoperable. The end result is that the system simply shuts down and no application can run.

Many operating systems today include programming that automatically scans for memory leak and will alert the user to the problem. In addition, a number of anti-virus software programs today include components that will identify bugs or viruses that can cause a memory leak, and destroy them before there is a chance for the problem to do much damage. Both approaches are very helpful in preventing and dealing with incidences of memory leak.

Friday, March 27, 2009

First convert Hex to Byte Array(http://www.codeproject.com/KB/recipes/hexencoding.aspx)



string hexString = txtHex.Text;

int discarded;

txtByteCount.Text = ((int)HexEncoding.GetByteCount(hexString)).ToString();

txtLength.Text = hexString.Length.ToString();

byte[] byteArray = HexEncoding.GetBytes(hexString, out discarded);

txtDiscard.Text = discarded.ToString();

string temp = "";

for (int i=0; i


{

temp += byteArray[i].ToString("D3") + " ";

}

txtByte.Text = temp;

txtHex2.Text = HexEncoding.ToString(byteArray);






Then Convert Byte Array to Image

(https://secure.codeproject.com/KB/recipes/ImageConverter.aspx?fid=337686&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2182648)

public Image byteArrayToImage(byte[] byteArrayIn)

{

MemoryStream ms = new MemoryStream(byteArrayIn);

Image returnImage = Image.FromStream(ms);

return returnImage;

}






After that image to any type (gif etc)

public byte[] imageToByteArray(System.Drawing.Image imageIn)

{

MemoryStream ms = new MemoryStream();

imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);

return ms.ToArray();

}






Also



img=Image.FromFile("test.jpg");
img.Save("test.png",ImageFormat.Jpeg); //so simple :-)






Also the useful links



http://www.codeproject.com/KB/web-image/pnguploader.aspx

http://msdn.microsoft.com/en-us/library/ktx83wah.aspx

Wednesday, March 18, 2009

ACE questions

Q1. What is default frame rate of the timeline in frame per second ?

* A. 1
* B. 12
* C. 24
* D. 30

Q2. What is the effect on the instances of a symbol if the symbol itself is changed ?

A. All instances change accordingly.
B. Only future instances change accordingally.
C. Only the current selected instance changes accordingly.
D. Symbols cannot be changed once instance of the symbol have been created.

Q.3 What is the key purpose of using layers in a timeline ?

A. To determine when things appear in your movie.
B. To separate assets playing at different .
C. To handle the four button states
D. To organize the stacking order of assets.

Q4. Which of the following is the recommended character to use to separate target level paths levels?

A. / (slash)
B. $ (Dollar sign)
C. _ (underscore)
D. % (percentage sign)

Q5. If the oilpump movie clip instance in path _root.car.engine.oilpump.clamp uses the following line of actionscript, _parent.someAction;, which movie clip instance is being referenced ?

A. Car
B. Engine
C. Oilpump
D. Clamp

Q6. How many levels does Flash MX support ?

A. 20
B. 80
C. 100
D. 1000

Q7. In which level does the original movie resides ?

A. 0
B. -0
C. 1
D. -1



Q8. What happens if an .swf is loaded into a already occupied level ?

A. An error is thrown.
B. The new swf is rejected and the old one stays.
C. The old swf is unloaded and the new swf is loaded.
D. They share the same level

Q9. What are the correct statements consenting text field ? (Choose Two)

* A. Embedded font outlines are shared by text fields using the same font.
* B. Font Outlines for static for static text field are embedded in the SWF file by default.
* C. Font outline for input text field are embedded in SWF file by default.
* D. Individual font outlines are embedded in to the SWF file for each text field in the FLA file.
* E. Font outlines for dynamic text fields are embedded in SWF file by default.

Q10. What is the function of trace ?

* A. Initiate the automatic debugging procedure.
* B. Discover who has downloaded your movie.
* C. Send String Values to the output panel.
* D. Determine what objects are presents on stage ant any one time.

Q11. Which statement concerning symbol instance statements are correct? (Choose Two)

* A. The Hit State of a Button Symbol instance is invisible at runtime.
* B. Graphic symbol instances may be directly controlled using action script.
* C. If a fill color in a graphic symbol is changed, all instances of graphic symbols are changed.
* D. A movie clip symbol instance may have a different frame rate than the main timeline.


Q12. What is the advantage of progressive video download ?

A. The frame rate of video file can be different from the frame rate of the SWF file..
B. Delivery of media is more secure than streaming video, because media does not get saved to the client cache when streamed.
C. To play the progressive download video, the entire movie must be downloaded before video will be start to play.
D. It usages less of the client memory and disk space than the streaming video download.

Q13. What methods are used to pass variables out of flash to a server side solution ? (Choose Three)

* A. LoadVars
* B. GotoAndStop
* C. getURL
* D. LoadMovie

Q14. What is needed when using static text to have font outline embedded in SWF file ?

* A. Nothing, Font outline are embedded by default.
* B. Select new font in the library panel menu.
* C. Select the alias button in the properties panel.
* D. Select use device font form the properties panel.

Q15. A button instance is named circle_btn. Actionscript is placed on the main timeline so that the button is clicked a movie clip instance named rec_mc's width is changed to 100.

What is the code to perform this action ?

* A. circle_btn.onRelease = function() {this.width=100;}
* B. circle_btn.onRelease = function() {rec_mc.width=100;}
* C. Circle_btn.onRelease = function() {rec_mc.width=100;}
* D. circle_btn.onRelease = function() {rec_mc._width=100;}

Monday, March 9, 2009

STAFF NOTICE - TOILET POLICY

STAFF NOTICE - TOILET POLICY :
Effective immediately, a toilet policy will be established to provide more consistent method of accounting for staff during working hours, thus ensuring effective time management & equal treatment of all. In the future, the doors to all toilets will be equipped with computer linked voice recognition devices, which can only be activated to open at the sound of a person's voice. Staff must therefore immediately provide management with 2 voice prints, one in normal tone & one under stress/desperation.


The following rules shall also apply:

1. On the first day of every month, all staff will be issued 22 toilet trip
credits.

2. Once toilet trip bank reaches zero, the doors of the toilet will
not unlock to your voice until first day of next month.

3. All cubicles are to be equipped with timed roll extractors. If stall
occupied more than 3 minutes, alarm will sound. Paper will retract into
dispenser 30 seconds later and toilet will flush and door will open.

4. If toilet remains occupied, your photo will be taken and appear on TOILET
OFFENDERS
board.

5. Anyone caught smiling will undergo counseling.

6. Be advised that workers company insurance does not cover any injuries incurred
while trying to stop toilet paper retracting into dispenser, or keep door from
opening.

hahaha.. too humourous......