Hi,
I'm a newbie to Flash MX.
Have set up a scene (home page) to another scene (photo gallery)... The scenes when tested separately are working fine but when I tried to view the photo gallery using a button on the home page, it replays the home page... Another problem that i faced was after loading the photo, the photo remains there when i navigate to other scenes. Can anyone pls help??? Thks in advance!!!
In home page, the button that links to photo gallery has the following action script:
on(release){
gotoAndPlay("Scene 2");
};
In the photo gallery (Scene 2), the movie clip has the following action script:
onClipEvent (load) {
_root.gotoAndStop(2);
}
And the action script to display the photos is:
Frame 1:
_global.a_th = 80;
_global.a_ta = 70;
_global.colunas = 3;
_global.linhas = 3;
var PhotoAlbum = {thumbs:[]};
photo_xml = new XML();
photo_xml.ignoreWhite = true;
stop();
Frame 2:
photo_xml.onLoad = function() {
bjork_th.html = true;
bjork_th.htmlText = "<p align=\"center\"></p>";
Photos_Bjork(0);
};
_global.Photos_Bjork = function(carregar) {
var photos = photo_xml.firstChild.childNodes;
var p_thumbs = photo_xml.firstChild.attributes.thumbs,
p_photos = photo_xml.firstChild.attributes.bjorks;
var i = carregar;
for (var l = 0; l<linhas; l++) {
for (var c = 0; c<colunas && i<photos.length; c++, i++){
var thumb = bjork_th.createEmptyMovieClip("thumb_"+i, i);
PhotoAlbum.thumbs.push(t);
thumb._y = l*a_th;
thumb._x = c*a_ta;
thumb.createEmptyMovieClip("photos", 1);
thumb.photos.loadMovie(p_thumbs+"/"+photos.attributes.thumb);
thumb.dimensoes = photos.attributes;
thumb.onRelease = function() {
bjork_photo._parent.alvo.unloadMovie();
bjork_photo.dimensoes = this.dimensoes;
bjork_photo.onEnterFrame = function() {
this._width += (this.dimensoes.largura-this._width)/3;
this._height += (this.dimensoes.altura-this._height)/3;
bjork_th._x = this._x+(this._width/2)+5;
bjork_th._y = this._y-(this._height/2);
if (Math.round(this._width) == Math.round(this.dimensoes.largura) && Math.round(this._height) == Math.round(this.dimensoes.altura)) {
this._width = this.dimensoes.largura;
this._height = this.dimensoes.altura;
delete this.onEnterFrame;
this._parent.createEmptyMovieClip("alvo", 1);
this._parent.alvo._x = this._x-(this._width/2);
this._parent.alvo._y = this._y-(this._height/2);
this._parent.alvo.loadMovie(p_photos+"/"+this.dimensoes.bjork_bw);
}
};
};
}
}
};
photo_xml.load("photos.xml");
stop();
I'm a newbie to Flash MX.
Have set up a scene (home page) to another scene (photo gallery)... The scenes when tested separately are working fine but when I tried to view the photo gallery using a button on the home page, it replays the home page... Another problem that i faced was after loading the photo, the photo remains there when i navigate to other scenes. Can anyone pls help??? Thks in advance!!!
In home page, the button that links to photo gallery has the following action script:
on(release){
gotoAndPlay("Scene 2");
};
In the photo gallery (Scene 2), the movie clip has the following action script:
onClipEvent (load) {
_root.gotoAndStop(2);
}
And the action script to display the photos is:
Frame 1:
_global.a_th = 80;
_global.a_ta = 70;
_global.colunas = 3;
_global.linhas = 3;
var PhotoAlbum = {thumbs:[]};
photo_xml = new XML();
photo_xml.ignoreWhite = true;
stop();
Frame 2:
photo_xml.onLoad = function() {
bjork_th.html = true;
bjork_th.htmlText = "<p align=\"center\"></p>";
Photos_Bjork(0);
};
_global.Photos_Bjork = function(carregar) {
var photos = photo_xml.firstChild.childNodes;
var p_thumbs = photo_xml.firstChild.attributes.thumbs,
p_photos = photo_xml.firstChild.attributes.bjorks;
var i = carregar;
for (var l = 0; l<linhas; l++) {
for (var c = 0; c<colunas && i<photos.length; c++, i++){
var thumb = bjork_th.createEmptyMovieClip("thumb_"+i, i);
PhotoAlbum.thumbs.push(t);
thumb._y = l*a_th;
thumb._x = c*a_ta;
thumb.createEmptyMovieClip("photos", 1);
thumb.photos.loadMovie(p_thumbs+"/"+photos.attributes.thumb);
thumb.dimensoes = photos.attributes;
thumb.onRelease = function() {
bjork_photo._parent.alvo.unloadMovie();
bjork_photo.dimensoes = this.dimensoes;
bjork_photo.onEnterFrame = function() {
this._width += (this.dimensoes.largura-this._width)/3;
this._height += (this.dimensoes.altura-this._height)/3;
bjork_th._x = this._x+(this._width/2)+5;
bjork_th._y = this._y-(this._height/2);
if (Math.round(this._width) == Math.round(this.dimensoes.largura) && Math.round(this._height) == Math.round(this.dimensoes.altura)) {
this._width = this.dimensoes.largura;
this._height = this.dimensoes.altura;
delete this.onEnterFrame;
this._parent.createEmptyMovieClip("alvo", 1);
this._parent.alvo._x = this._x-(this._width/2);
this._parent.alvo._y = this._y-(this._height/2);
this._parent.alvo.loadMovie(p_photos+"/"+this.dimensoes.bjork_bw);
}
};
};
}
}
};
photo_xml.load("photos.xml");
stop();