Flash as a common code collection

Source: Internet
Author: User
Tags html page join
1, with Flash to do that kind of pop-up window
A two-step:
Add the following action to the button in Flash:
On (release) {
GetURL ("Javascript:mm_openbrwindow" (' newweb.htm ', ', ', ' width=600,height=100 '));
}

Add the following JavaScript code between the <script language= "JavaScript" >
<!--
function Mm_openbrwindow (theurl,winname,features) {//v2.0
window.open (Theurl,winname,features);
}
-->
</script>

2, how to make flash open is full screen?
Fscommand ("fullscreen", true)
How can I use the right key?
Fscommand ("ShowMenu", "false");

3, with the command to load an animation, I need to determine the loading animation in the picture position, in what language to set?
For example, to load an animation named dd.swf, I want to determine the center position of this animation in (205,250), how to set?
Join the clock that is going to load the animation
Loadmovie ("dd.swf", "a");
a._x=205;
a._y=250;
You have to do an empty MC first name "A", when imported, in the lower right corner also named a

4. When the mouse passes, the animation plays to a place
On (rollover) {
gotoAndPlay (10);
}
Animation plays to a place when the mouse is pressed
On (release) {
gotoAndPlay (1);
}

5. Automatically jump to a webpage after the animation is finished
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 ");
}

Note the ID number of the flash in the Web page is named "Links"

Join Favorites
On (release) {
GetURL ("Javascript:void window.external.AddFavorite" (' http://www.163.com ', ' web '); "," _self "," POST ");
}

7. Tips on random numbers
Used to produce 5 distinct random numbers between 6--20:
1): First produces a random number, placed in the array object in the first position;
2): A new random number is generated.
3): Check the new random number and all the current generated random number is the same, if the same return (2), or return (4)
4: Adds the new random number to the next array element in the array object.
5): Check whether the number of array objects has reached 5, if the Jump to (6), or return (2)
6): End.
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 make flash open is full screen
The method that is used here is only for Flash Player (FP)

9, how to prohibit the right button menu
The Fscommand method can only be used for FP, or you must add additional parameters to the Web page
<param name= "Menu" value= "false" >
Or use the simplest sentence as, in the FP and Web pages are applicable:
Stage.showmenu=false;

10, the problem of loading animation
Loadmovie ("dd.swf", a); There are no quotes here ~

11. Automatically jump to a webpage after the animation is finished
GetURL ("siteindex.htm", "_self"); Here are quotes ~



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.