Thursday, 22 August 2013

How to Create XML File

XML file consists of the parameters and the contents we need to access in our flash program.
There can be two or more methods to create an xml file but here we are using two methods for creating an xml file.

Methods of creating XML file:
Notepad: the basic method of creating an xml file is the use of notepad, in which we write our own HTML codes. And after doing that it could be saved directly in .xml extension. Here is a sample code for creating an xml file in a note pad.
<dictionary>
<words>
<word> Abnigate </word>
<meaning> jhbjh </meaning>
<hind> khgjkhgt</hindi>
</words>
<words>
<word> Abnigate </word>
<meaning> jhbjh </meaning>
<hind> khgjkhgt</hindi>
</words>
<words>
<word> Abnigate </word>
<meaning> jhbjh </meaning>
<hind> khgjkhgt</hindi>
</words>
</dictionary>
-save the code with .xml extention

But for huge number of data we use another method, but before that we need to have a schema file which consists of parameters we need in our xml file. The schema file approaches one more step that it adds up with the EXCEL file.

For creating schema file we can write the code either in HTML or in VBA (Visual Basic), so here we generate the .xsd file with VBA by using the following code:

Sub createxsd()

   Dim StrMyXml As String, MyMap As XmlMap
   Dim StrMySchema As String
   StrMyXml = "<Dictionary>"
   StrMyXml = StrMyXml & "<Words>"
   StrMyXml = StrMyXml & "<Word>Text</Word>"
    StrMyXml = StrMyXml & "<Hindi>Text</Hindi>"
    StrMyXml = StrMyXml & "<Meaning>Text</Meaning>"
   StrMyXml = StrMyXml & "</Words>"
   StrMyXml = StrMyXml & "<Words>"
   StrMyXml = StrMyXml & "</Words>"
   StrMyXml = StrMyXml & "</Dictionary>"

   ' Turn off async loading.
   Application.DisplayAlerts = False
   ' Add the string to the XmlMaps collection.
   Set MyMap = ThisWorkbook.XmlMaps.Add(StrMyXml)
   Application.DisplayAlerts = True

   ' Create an empty file and output the schema.
   StrMySchema = ThisWorkbook.XmlMaps(1).Schemas(1).XML
   Open "destination.xsd" For Output As #1
   Print #1, StrMySchema
   Close #1
End Sub

And  in Note pad we can write the code in a simple manner
<dictionary>
<words>
<word> text </word>
<meaning> text </meaning>
<hind> text</hindi>
</words>
</dictionary>

After creating xsd file we can easily use another method for creating xml file.

EXCEL sheet: This could be a easy way for creating a large data of xml file. As we have created the xsd file above, we learn how to call it and do the processing.


- Goto Developer bar
- Click to Source option
- A a dialogue box will open-> click to XML Maps
- Search for the directory in which the xsd file have been saved






















- Now the parameters could be seen on the right box from there drag the parameters and drop to that column which is to be selected for the particular operation.
- Click to Export for generating the xml file.

Wednesday, 21 August 2013

Components of Flash Animation


There are predefined gallery of buttons in flash CS-5.5 which could be used easily by dragging and dropping to the stage. But one can also make his own button by using the tools option.




Actions can be provided to these buttons by going to the timeline bar->over frame->right click->actions and there we get a number of actions which could also be extracted from the code snippets, in which there are other predefined functions which could be used as per conditions. By clicking to the object/button, one selects the object/button to get an action in it-> then add the action to the object/button by right clicking to the action you want from the code snippets and select add to frame, this will add action to the button for that Particular Frame.



For animation on buttons one can simply double click the the button to be animated-> click to the XY location of the button-> here one can select the location in XY direction of the button and can see animation during execution of the file.


Sunday, 18 August 2013

Adobe Flash Animation Basics

A movie consists of scenes and a scene consists of sequence of frames. So the number of frames shown in 1 second is called a scene(default 24FPS). A frame consists of number of layers (front layer, middle layer, background layer). In a timeline bar we have number of frames varying along with time in seconds, in which we can change the number of frames in three parts namely: 
1. Frame (F5)
2. Key Frame (F6) 
3. Blank Frame (F7) 

1. Frame: option would insert the current frame and end it to the next second of the timeline. Here no changes can occur. 
2. Key Frame: option is used when there is need of a new frame having the same content of the older frame and could be changed in it. 
3. Blank frame: is used to start a new frame with a blank frame in which fresh editing could be done. 

In Property bar, properties of the stage or the document could be changed by changing the Frames per second, Size of the document and stage color. The current size of the document could be made as default by clicking to the settings of the size and click to the "Make Default". Next time when you create new project the default documents gets opened.

Adobe Flash CS has an option for changing the view of the workspace according to the comfortability of the user. Simply by clicking to the ESSENTIAL option we can have number of dropped down options listing the suitability of the user. The most important thing in this software is tools which could help user to create his/her own shapes and drawings or even can do other options like selection and subselection etc. The selection option selects the total area of the bounded part whereas sub-selection option selects the total number of lines intersecting or joining each other.