Prev | Current Page 623 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

swf position when the movie is played by the standalone Flash Player, but will be
relative to the containing web page when the movie is embedded in an HTML document.
Remember also that the Flash security policy forbids loading remote files under certain circumstances.
Part II: Server Side, JavaScript, and Flash: Oh My!
324
Loading an Image in Flash 6 to 8
The loadMovieMethod() can load SWF, JPG, GIF (only unanimated), or PNG files. GIF, PNG, and
progressive JPG have been introduced with version 8. To create the container movie clip, the same
technique adopted earlier is applied.
import flash.Lib;
import flash.MovieClip;
class Main
{
public static function main()
{
var mc = createMovieClip();
mc.loadMovie(???picture.jpg???);
}
#if flash6
private static var currentdepth = 0;
#end
private static function createMovieClip(?parent : MovieClip) : MovieClip
{
if(parent == null)
parent = Lib.current;
#if flash6
var depth = ++currentdepth;
#else true
var depth = parent.getNextHighestDepth();
#end
return parent.


Pages:
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635