Highlights of common Flash code

Source: Internet
Author: User
1. Use flash for small pop-up windows
In two steps:
Add the following action to the buttons in flash:
On (release ){
GetURL ("javascript: mm_openbrwindow('newweb.htm','', 'width = 600, height = 100 ')");
}
Add the following javascript code between the HTML page.

2. How can I enable full screen when flash is enabled?
Fscommand ("fullscreen", true)
How can I not right-click it?
Fscommand ("showmenu", "false ");

3. When I use commands to load an animation, I need to determine the position of the animation on the screen. In what language can I set it?
For example, if an animation named "dd.swf" is loaded, I want to make sure that the animation is in the center of (205,250). How can I set it?
Add to the animation
LoadMovie ("dd.swf", "");
A. _ x = 205;
A. _ y = 250;
You must first name an empty MC named "a". During import, it is also named a in the lower right corner.

4. When the mouse passes, the animation is played somewhere.
On (rolover ){
GotoAndPlay (10 );
}
When you press the mouse, the animation is played somewhere.
On (release ){
GotoAndPlay (1 );
}

5. automatically jump to a webpage after broadcasting the animation
GetURL ("siteindex.htm", _ self );

6. Set as Homepage
On (release ){
GetURL ("javascript: void (document. links. style. behavior = 'url (# default # homepage) '); void document. links. setHomePage ('HTTP: // www.flash8.net/') "," _ self "," POST ");
}

Be sure to name the flash ID in the webpage as "links"

Add to favorites
On (release ){
GetURL ("javascript: void window. external. AddFavorite ('HTTP: // www.163.com ', 'web');", "_ self", "POST ");
}

7. Random Number Techniques
It is used to generate five non-repeated random numbers between 6-20:
1): first generate a random number and place it in the first position of the array object;
2): generate a new random number.
3): Check whether the newly generated random number is the same as all the currently generated random numbers. If they are the same, return (2); otherwise, return (4)
4): Add the new random number to the next array element of the array object.
5): Check whether the number of array objects has reached 5. If it is jumped to (6), otherwise (2) is returned)
6): end.
AS is AS follows:
Data1 = newArray (5 );
Tot = 1;
Data1 = [tot-1] = random (20-6 + 1) + 6;
Do {
Gen_data = random (20-6 + 1) + 6;
Reapeat_data = 0;
For (I = 0, I <= tot-1; I ++ ){
If (gen_data = data
Reapeat_data = 1;
Break;
}
}
If (reapeat_data = 0 ){
Tot ++
Data [tot-1] = reapeat_data;
}
} While (tot <5 );
Trace (data1 );

8. How to enable full screen flash
The method mentioned here is only used for flash Player (fp)

9. How to disable right-click menu
The fscommand method can only be applied to fp, and additional parameters must be added to webpages.

Or use the simplest sentence as, which is applicable to both fp and webpage:
Stage. showMenu = false;

10. animation Loading Problems
LoadMovie ("dd.swf", a); // No quotation marks ~

11. automatically jump to a webpage after broadcasting the animation
GetURL ("siteindex.htm", "_ self"); // There are quotation marks ~

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.