I have a question about clicking movieclip to go to and play.
Anyway, this movieclips are dynamic, load from database use xml.
And when I clicked one of the images, it can go to and play to frame 37. but the image from database doesn't disappear. the blue box is in frame 37 and the images is in frame 1. i use script stop(); but the images still appear just like image number 1.
here is my code : the
import flash.text.TextField;
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.text.TextFieldAutoSize;
import flash.display.Sprite;
var yPlacement: int = 700;
var line1xpos: int = -10;
var line2xpos: int = -10;
var line3xpos: int = -10;
var distance: int = 200;
var loader: URLLoader = new URLLoader(new URLRequest("http://192.168.136.148/coba/imageLoopRC.php"));
loader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event: Event): void {
var xmlData: XML = new XML(loader.data);
for each(var galleryFolder: XML in xmlData..galleryFolder) {
var galleryDir: String = galleryFolder.toString();
}
trace(xmlData);
var i: Number = 0;
for each(var menuXML: XML in xmlData..MenuItem) {
var picnum: String = menuXML.picnum.toString();
var thumb: String = menuXML.thumb.toString();
var nama: String = menuXML.nama.toString();
var namaTxt: TextField = new TextField();
namaTxt.autoSize = TextFieldAutoSize.CENTER;
namaTxt.textColor = 0xFE6795;
addChild(namaTxt);
var hargaTxt: TextField = new TextField();
hargaTxt.autoSize = TextFieldAutoSize.CENTER;
hargaTxt.textColor = 0xFE6795;
addChild(hargaTxt);
var thumbLdr: Loader = new Loader();
var thumbURLReq: URLRequest = new URLRequest(galleryDir + thumb);
thumbLdr.load(thumbURLReq);
var thumb_mc : MovieClip = new MovieClip();
thumb_mc.addChild(thumbLdr);
addChildAt(thumb_mc, 1);
if (picnum < "17") {
line1xpos = line1xpos + distance;
thumb_mc.x = line1xpos;
thumb_mc.y = yPlacement;
namaTxt.text = menuXML.nama.toString();
namaTxt.x = line1xpos;
namaTxt.y = thumb_mc.y + 130;
hargaTxt.text = "Rp " + menuXML.harga.toString();
hargaTxt.x = line1xpos;
hargaTxt.y = namaTxt.y + 15;
} else if (picnum > "16" && picnum < "23") {
line2xpos = line2xpos + distance;
thumb_mc.x = line2xpos;
thumb_mc.y = yPlacement + 200;
namaTxt.text = menuXML.nama.toString();
namaTxt.x = line2xpos;
namaTxt.y = thumb_mc.y + 130;
hargaTxt.text = "Rp " + menuXML.harga.toString();
hargaTxt.x = line2xpos;
hargaTxt.y = namaTxt.y + 15;
} else if (picnum > "22" && picnum < "29") {
line3xpos = line3xpos + distance;
thumb_mc.x = line3xpos;
thumb_mc.y = yPlacement + 400;
namaTxt.text = menuXML.nama.toString();
namaTxt.x = line3xpos;
namaTxt.y = thumb_mc.y + 130;
hargaTxt.text = "Rp " + menuXML.harga.toString();
hargaTxt.x = line3xpos;
hargaTxt.y = namaTxt.y + 15;
}
thumb_mc.addEventListener(MouseEvent.CLICK, clickToSeeStuff);
function clickToSeeStuff(event: MouseEvent): void {
gotoAndPlay(37);
}
}
}
Please help me to fix this.
Forgive my bad English. thanks anyway