Frequently asked questions, I am faced with the use of new programming languages in a familiar programming environment, such as the Flash being, I am overwhelmed by new languages and creative solutions, help the two languages communicate with each other. Flash and XML are no exception. If you are in the same category as me, the purpose of this tutorial is to keep in mind with you. If you are not in the same category, you may still want this tutorial!
This tutorial will help you create a simple, straightforward example that does not deviate from unrelated functions, efficient coding methods, etc. If this is your first attempt to create something that uses XML in Flash, I believe this is a better way to build your trust and create a simple one for you, such as work, and then modify the features that are increasingly complex, making your work more decent.
The following is an example. You will create one:
[The inventor of the above data is to load an XML file]
--------------------------------------------------------------------------------
Let's get started.
Let's create an XML file first. I will pay the basic XML file later in this tutorial, but you can also see the base of senocular's great tutorial XML.
Create an XML file
The following steps explain how to create an XML file:
Start a program to edit plain text, ASCII text, such as Notepad.
Copy and paste the following code in Notepad (or equivalent program:
<? Xml version = "1.0"?>
<Inventors>
<Person>
<Name> Thomas Edison </name>
<Comment> Inventor of parameter things such as the incandescent lightbulb. </comment>
</Person>
<Person>
<Name> Doug Engelbart </name>
<Comment> specified Ted the mouse at the Stanford Research Institute </comment>
</Person>
</Inventors>
It may seem strange to paste your things, but don't worry. Just make sure to copy and paste it to your text editor (Notepad, etc)
Save this file as inventors. xml to a hard drive in one location. Do not forget to save this file, so that you can save your Flash file at this location.
Create a Flash file
The following steps explain how to create a Flash file:
First, if you do not feel that you have re-created my above Flash interface, I strongly recommend that you download some FLA that only contain color boxes and text labels.
If you do not feel that you have downloaded FLA and want to re-start the file from scratch, make sure that all your painting and writing will eventually create a similar image:
[Make your interface look similar to the above]
Now, anyone should have an image similar to the above on the screen. If you use my FLA, you will have the exact image above the screen.
Let's add text fields. Click your text tool icon from the toolbox.
Click the text tool to make sure that the dynamic text is selected from your property panel.
[Select dynamic text]
Now, two text fields are used. Use the name text on the right of the text field and the comment text on the right of other text fields.
The extensive text field allows you to easily display text. Try to make the comment text next to your text field a little high, because it contains more text than the text field name:
[Make your text field large enough]
Therefore, we have drawn our text fields. However, we do not have a named text field! Let's do this. The text field of the selected name. On the property panel, give it the name (for example, name): name_txt
[Name Your name text field instance name name_txt]
Similarly, select the comment text field and give it the name: comment_txt
The text field of your comment. You should set many line types. This eliminates the need for text, and summarizes and displays the following guidelines:
[Enable multiple comment text fields]
Now, you have text fields formatted and named. It's time to move on. Save the file to the same location and you saved your XML file.
Well, the easy part is now the end. In the next page, you will add code to make the text XML file flash. You can also learn some code behind the theory, so that you can create things much cooler than I have created this tutorial.