Control
Today to tell you about the use of the keyboard in Flash to control the movement of objects in two ways, is the use of Flash ActionScript updateafterevent and onenterframe to achieve.
When viewing the effect, click the Flash movie with your mouse to see the effect with the keyboard key.
First look at the effect
We make a nice movie to import the progress bar.
First look at the effect.
Prepare a Picture:
Then import to the stage, select the diagram with the mouse, and then open the Alignment panel, set as follows.
Then press F8 to convert to the movie clip symbol, named PICTURE_INSIDE_MC. Then press CTRL+J to modify the document properties.
Then press Ctrl+f8 to create a PICTURE_MC
Flash files are currently popular in the network, many online video playback sites are used in this format, whether it is film, video, animation, songs, CG games, or self-portraits, etc., can be made into flash files to appreciate. Small file size, but also vivid, want to make people do not like also difficult! However, the system defaults to the Macromedia Flash
Event
Method
Description
On (Press)
Onpress
Left mouse button pressed
On (release)
Onrelease
Mouse click (left button pressed and released)
On (releaseoutside)
Onreleaseoutside
After the left mouse button is pressed and released outside the buttons
On (rollover)
Onrollover
Hover the mouse over the button
On (RollOut)
Onrollout
Mouse moves outside the button response area
On (Dr
The Selects the first frame on layer 1 in the timeline. Select Window > action to open the Actions panel (if it is not already open). Add the following code in the Actions panel:
code is as follows
copy code
This.createemptymovieclip (" BOX_MC "); With (BOX_MC) { beginfill (0xff0000); moveTo; LineTo (200, 100); LineTo (200, 200); lineTo (100, 200); lineTo (100, 100); Endfill (); } This.createtextfield ("Status_txt", 999, 0, 0, MB); var m
Skill _root.createemptymovieclip ("MC", _root.getnexthighestdepth ());
Mc.loadmovie ("logo.gif");
Trace (mc._width);
The result, though, is 0, because the Loadmovie has a delay, and the external real movie can be loaded into the Loadmovie after the second frame. So:_root.createemptymovieclip ("MC", _root.getnexthighestdepth ());
Mc.loadmovie ("logo.gif");
_root.onenterframe = function () {
Trace (mc._width);
};
The effect is coming out.0888888.......A
/*
Use as drawing to add a black box to the movie ("Headmistress")
By:www.ddup365.net
Www.ddup365.net/bbs
Original address: Http://www.ddup365.net/bbs/viewthread.php?tid=121extra=page%3D1
*/
Fscommand ("Allowscale", "false");
This.createemptymovieclip ("Img_mc", this.getnexthighestdepth ());
A = Stage.width;
b = stage.height;
With (IMG_MC) {
Beginfill (0x000000, 100);
MoveTo (0, 0);
LineTo (0, B);
LineTo (A, b);
LineTo (A, 0);
MoveTo (-A, -3*b);
LineT
This example is going to achieve the kind of subtitle display that the Star Wars opening. The focus of this section is to create a movie clip in real time and draw a starry background using drawing method (painting methods) of random functions and movie clips. The main film structure is shown in the following illustration.
Figure 1 Film structure
As you can see from the above picture, the structure of t
Event
Method
Description
On (press)
OnPress
Press the left mouse button
On (release)
OnRelease
Click (left click and release)
On (releaseOutside)
OnReleaseOutside
Click the left mouse button and release it outside of the button.
On (rolover)
Onrolover
Hover the mouse over the button
On (rolout)
Onrolout
Move the mouse outside the response area of the button
On (dragOver)
OnDragOver
Hover the mouse ove
) Add the following ActionScript in the "New Lesson import" button:
On (release) {
Telltarget ("XK") {
gotoAndPlay (2);}
}
This completes the connection of the movie.
(5) The same method, set the other module's movie connection.
2. Realization of interactive function
Using the above method, we can also realize the interactive function of courseware, and we choose the example to illustrate.
(1) The menu "ins
AS3.0 dynamically change the color of a movie clip
The code is as follows
Copy Code
var a:colortransform = new ColorTransform ();A.color = 0x000000;Mc.transform.colorTransform = A;Stage.addchild (MC);Change the color of the MC
ColorTransform () constructor
The code is as follows
Copy Code
Public Function ColorTransform (Redmultiplier:number = 1.0, Greenmultiplier:number = 1.0, Bluemul
covered in red.Flash depth is divided into 3 regions:Timeline Area ( -16384~-1)Mainly used to place the Flash IDE editor image, MC, etc., this area of the MC can not be deleted with AS, but can be used as dynamic creation of the MC here.Dynamic Area (0~1048575)Allows you to dynamically create or delete an MC using as as when executing.Reserved area (1048576~2130690045)The MC can be created dynamically with as as is allowed, but cannot be deleted afte
Ask, the movie website "You also may like the following movie" This function how to realize?
What points of knowledge are involved?
Reply content:
Ask, the movie website "You also may like the following movie" This function how to realize?What points of knowledge are involved?
Point of interest search, such as w
Line.onenterframe = function (){if (this._currentframe!= this._totalframes){This.nextframe ();}Else{Container.loadmovie ("team.swf");This.btn1.onRelease = function (){Container.loadmovie ("team.swf");};This.btn1.onRollOver = function
To load an animation with a command, I need to determine where to load the animation in the screen.
For example, to load an animation named webjx.swf, I want to determine the center position of this animation in (100,200), how to set?
Add the
Skills
Toss all morning and sort out these two methods.
Method One (Recommended): Moviecliploader method
var mccontainer:movieclip = This.createemptymovieclip ("Mymc", this.getnexthighestdepth ());var mcloader:moviecliploader = new Moviecliploader ()
Python2.7mac OS
Crawling is the latest movie page in the movie Paradise. Link Address: http://www.dytt8.net/html/gndy/dyzz/index.html
Get a link to the movie Details page in the page
Import Urllib2import osimport reimport string# Movie URL Collection movieurls = []# get movie
Step One: We open the PPT 2007 software, and then we click on the PowerPoint option in the upper right corner---common---tick "then we'll find the Developer tab", OK now there's a developer tab in the PPT menu.
Step Two: Now we create a Shockwave Flash Object object instance in ppt, then we then in "Development toolbar"-"Control"---"Other controls", then we click "Shockwave Flash Object", click
: FFEEAA indicates that the red value is FF, the green value is EE, and the blue value is AA.Example: Set the movie background color to red:Movie. BGColor = "FF0000"5.DeviceFont (read/write)Syntax: Devicefontas BooleanDescription: Determines whether to use the font embedded in the movie, and the default value is False. Setting this property value to True forces the player to use the Local system font withou
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.