Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
22-2
FLASH8
22-1
( < \ \ ch22 \ loading.swf> )
Flash Flash
22-3
22
22-1-1 Flash swf
MovieClip getBytesLoaded() getBytesTotal ()
1. getBytesLoaded()
2. getBytesTotal ()
MovieClip
Math.round(this.getBytesLoaded()/this.getBytesTotal() * 100);
Math.round()
MovieClip _framesloaded _totalframes
1. _framesloaded
2. _totalframes
22-4
FLASH8
22-1-2 <C:\morocco\loading.fla> (
< \ \ morocco \ loading.fla> <C:\morocco>
)
1 ~2 1
[ ] [ ] pctLoaded
Bar [ ] bar_mc
3 1 5
1~2
3
22-5
22
actions
ActionScript
1. actions 1 [F9] [ ]
2. ActionScript
/ /
var pctLoaded = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100);
pctLoaded
pctLoaded
22-6
FLASH8
/ /
this.bar_mc._xscale = pctLoaded;
bar_mc
pctLoaded X
1. actions 2 [F9] [ ]
2. ActionScript
/ / 1 3
if (this._framesloaded<this._totalframes) {
this.gotoAndPlay(1);
} else {
this.gotoAndStop(3);
}
1
[Ctrl] + [Enter]
1. [Ctrl] + [Enter]
2. [Ctrl] + [Enter]
22-7
22
[Ctrl] + [Enter] [ ] \ [ ]
( < \ \ ch22 \ loading.fla>
)
[Ctrl] + [Enter] [ ] \ [
]
[ ] \ []
22-8
FLASH8
22-2
Flash Flash HTML
Flash HTML JavaScript
( < \ \ ch22 \ index.html>
)
22-9
22
22-2-1 Flash Flash getURL()
Flash
getURL
URL URL
getURL()
getURL (URL [, ][ , ]) ;
1. URL URL http://www.myserver.com/
2. HTML
(1) _self
(2) _blank
(3) _parent
(4) _top
3. GET POST
GET URL POST
HTTP
22-10
FLASH8
Flash
1.
getURL("http://www.e-happy.com.tw , _blank )
http://www.e-happy.com.tw
2.
mailto:
getURL("mailto:[email protected] )
3. JavaScript Flash HTML JavaScript
JavaScript javascript:
HTML window.close()
Flash
getURL("javascript:window.close();");
HTML alert( )
Flash
getURL("javascript:alert( );");
JavaScript HTML
playMovie()
getURL("javascript:playMovie();");
22-11
22
22-2-2 <c:\morocco\index.fla> (
< \ \index.fla> <c:\morocco> )
<index.fla>
<index.fla>
<index.fla>
[ ] [ ]
22-12
FLASH8
<c:\morocco> <buttons.fla> <buttonMusic.fla> (
< \ \ ch13> <buttons.fla>
<buttons.fla> <c:\morocco> )
<index.fla>
1. [F9] [ ]
on (release) {
getURL("http://www.e-happy.com.tw", "_blank");
}
2. ActionScript
http:/ /www.e-
happy.com.tw
22-13
22
1. [F9] [
]
2. ActionScript
on (release) {
getURL("mailto:[email protected]?subject= ");
}
mailto E-mail?cc=
mailto E-mail?bcc=
mailto E-mail+?body=
mailto E-mail?subject= &cc=&body=
22-14
FLASH8
1. [F9] [
]
2. ActionScript
on (release) {
getURL("javascript:window.external.AddFavorite('http://morocco.e-happy.com.tw','
');");
}
window.external.AddFavorite( , );
22-2-3
.swf .html
[ ] \ [ ] [
] [ ]
Flash (.swf) HTML (.html)
[Flash] [HTML]
22-15
22
Flash
[Flash]
Flash
Flash Player ActionScript
F l a s h P l a y e r 8
ActionScript 2.0
HTML
[HTML]
Flash
1. Flash
8
F l a s h
Player
2. [ ]
Flash
22-16
FLASH8
[ ]
[ ] \ [ ]
.swf .html
JavaScript
HTML
22-17
22
Flash
[Macromedia Flash Player ] [ ]
Macromedia Flash Player
Flash Player
Flash
IP Flash Player
22-18
FLASH8
1. [Macromedia Flash Player ] [ ]
http://www.macromedia.com/support/documentation/tw/flashplayer/help/
settings_manager04a.html
2.
3.
22-19
22
4. [ ] [ ]
[ ]
5. [
]
22-20
FLASH8
< \ ch22 \ \ .fla>
1. [F9] [ ] ActionScript
on (release) {
getURL("http://www.e-happy.com.tw", "_blank");
}
22-21
22
2. [F9] [ ] ActionScript
on (release) {
getURL("mailto:[email protected]?subject= ");
}
3. [F9] [ ] ActionScript
on (release) {
getURL("javascript:window.external.AddFavorite('http://www.e-happy.com.tw','
');");
}
4. [ ] \ [ ] [ ]
(1) [ ] Flash (.swf) HTML (.html)
(2) [Flash] [ ] Flash Player 8 [ActionScript ]
ActionScript 2.0
(3) [HTML] JavaScript
FSCommand Flash
[ ]
5. .swf .html