Load external image dengan AS3 - Flash - Publisher - Royz Rambo
Ilham Penta
Site menu
Section categories
My articles [6]
Java [14]
Java Programming
Flash [6]
Flash
URL web dan Tutorial [29]
Petualangan [1]
Our poll
Rate my site
Total of answers: 19
Statistics

Total online: 2
Guests: 2
Users: 0
Login form
Main » Articles » Flash

Load external image dengan AS3
01//menginisialisasi loader
02//loader digunakan untuk menampung gambar
03var loader:Loader = new Loader();
04 
05//url request digunakan untuk mengubah alamat yang bertipe string
06//menjadi URL
07var request:URLRequest = new URLRequest("flash_logo.jpg");
08 
09//melakukan load
10loader.load(request);
11 
12//membuat movieclip kosong

contoh url gambar http://www.ziddu.com/download/9372414/loadGambarAS3.rar.html
13var movie = new MovieClip();
14//menambahkan event onPress
15movie.addEventListener(MouseEvent.MOUSE_DOWN, onMoviePress);
16//menambahkan event onRelease
17movie.addEventListener(MouseEvent.MOUSE_UP, onMovieRelease);
18//memasukkan loader kedalam movie
19movie.addChild(loader);
20//memasukkan movie kedalam stage/root
21addChild(movie);
22 
23//fungsi ketika diklik
24function onMoviePress(e:MouseEvent){
25    //melakukan start drag
26    e.currentTarget.startDrag();
27}
28 
29//fungsi ketika dilepas
30function onMovieRelease(e:MouseEvent){
31    e.currentTarget.stopDrag();
32}


Source: http://flashindonesia.org/2010/04/menampilkanload-gambar-di-luar-flash-actionscript-3-0/
Category: Flash | Added by: penta (2010-10-12)
Views: 547 | Comments: 3 | Tags: flash 8, load image, AS3 | Rating: 0.0/0
Total comments: 0
Name *:
Email *:
Code *:
Search
Site friends
  • Create a free website
  • Copyright Penta.Inc © Powered By: Senjapala