Project Needs, start learning flash

Source: Internet
Author: User

Project Needs, start learning flash
A good memory is worse than a bad pen. Learn and remember it. Let's take a look at learning in my own way. It takes a long time to learn some simple programming. It's enough, and I don't have much energy to thoroughly understand the "Buddha .~ _~
In terms of syntax, we knew it was similar to Js.
The array is basically the same.
1,
// Practice the Array application;
VaR myarr = new array ();
Myarr [0] = "";
Myarr [1] = "Mathematics ";
Myarr [2] = "chemistry ";
VaR temp = "";
For (VAR I = 0; I temp + = myarr [I];
}
Test.html text = temp;

Trace (temp );

Note the usage and meaning of Trace [
Statement. In test mode, the expression is calculated and the result is displayed on the "output" panel.

When testing a video, you can use this action to record programming comments or display messages in the output panel. You can use the expression parameter to check whether a certain condition exists or to display the value in the output panel. The trace () action is similar to the alert function in JavaScript.

You can use the "omit trace actions" (Omitted Trace Action) command in "Release Settings" to delete the trace () action from the exported SWF file.

Remember that I think the trace function is enough.

In addition, we also found a difference from Js.
VaR I: Number = 5;
I personally do not like this method,
This is the explanation in the help box!
InCodeUse the colon (:) to specify the data type for the variable. To specify a specific data type for a project, use the VaR keyword and the colon syntax to specify its type, as shown in the following example:

// Strictly specify the type of the variable or object
VaR mynum: Number = 7;
VaR mydate: Date = new date ();
// Strictly specify the parameter type
Function welcome (firstname: String, myage: Number ){
}
// Specify the type of parameters and returned values.
Function Square (Num: Number): number {
VaR squared: Number = num * num;
Return squared;
}

You can declare the object data type based on the built-in classes (such as button, date, movieclip, and so on) and the classes and interfaces you have created. The following code snippet creates a new object of the custom type Student:

VaR firststudent: Student = new student ();

2. I cannot wait for a moment to finish the "Buddha".
then I learned the UDF
function test (s) {
trace (s)
}< br> // call a custom function;
test ("I Am a bunch of Spam! ");
Yes, it's that simple.
3. Use loadmovie () to dynamically load images.
if you don't talk much about it, you can see the example.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.