Flash點樣控制load出黎個swf位置同大小?

2007-04-16 8:18 pm
我在個button上打左,
on(release){
loadmovie("一二三.swf", this)
}

load就load到出黎, 但點樣控制佢個scale同位置呢?

回答 (2)

2007-04-16 9:54 pm
✔ 最佳答案
Suppose you want to load the swf with a dimension of 300 px X 200 px

1. Draw a rectangle with 300 px X 200 px with any color you like
2. Convert it to movie clip, e.g. loader_mc
3. Change the on release handler code above to:

on (release) {
loadMovie("一二三.swf", loader_mc);
}

Remember to enter the name loader_mc in the movie Clip property panel

The code that you wrote can not control the scale and position because you loaded the swf into [this]. if the button is on the root, then [this] will refer to [_level0]. _level0 is the top level and so the swf will be loaded to the stage directly. If you set to load it to the movieClip, then you can control the size and scale.

Another supplmentary note is that if you load a picture (JPEG format) into the movie clip, you have to use a movie clip loader also to handle the position and size. It's sth out of your question, so I just mention it as a supplmentary note. You can refer to the Flash documentations for details.
參考: I'm a flash developer
2007-04-16 8:39 pm
你用一個 MovieClip 來 load
之後 set 個 MovieClip

個 code 大約係
loadmovie("一二三.swf", themovieclip)

PS. 我有約2年冇玩過 Flash 了, 大約只記得 D concept ( 已前寫過同樣的東東 )


收錄日期: 2021-04-12 19:57:33
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070416000051KK01168

檢視 Wayback Machine 備份