Flipante, ya tenía casi todo escrito, pero era tan largo y pesado que ha petado la página...
Bueno empiezo de nuevo aunque ahora algo más escueto que no tengo tiempo...
Voy a hacer un esquema del archivo con sus códigos.
Empezaré poniendo un esquema gráfico de la estructura del archivo principal.
La primer capa contiene el código en ActionScript.
La segunda capa llamado labels, contiene etiquetas de nombres de fotogramas.
La tercera capa contiene el MC del menu, llamado menu_mc.
La cuarta capa contiene el MC de la galeria de imagenes, llamado pages.
Código del primer fotograma (linea principal).
Código ActionScript :
Stage.align = "MC";
Stage.scaleMode = "noScale";
url = "xxxxx";
loadVariablesNum((url + "_main.php"), 0);
intervalID = setInterval(check_loaded, 100);
_root.link = 1;
_root.link_prev = 0;
_root.G = 1;
stage_bg_animation.stage_bg._x = -1200;
stage_bg_animation.stage_bg._y = -1019;
Código del fotograma 2 (linea principal).
Código ActionScript :
function more_click_func(num){
if(_root.link != num && _root.G != 1){
if(_root.link == 4){
_root.menu_mc.gotoAndPlay("s2");
}
_root.G = 1;
_root.link_prev = _root.link;
_root.link = num;
_root.cover01.gotoAndStop(2);
_root.gotoAndPlay("s1");
}
}
Código del fotograma 3 (linea principal).
Código ActionScript :
pages._visible = 0;
Código del fotograma 13 (linea principal).
Código ActionScript :
pages._visible = 1;
Código del fotograma 14 (linea principal).
Código ActionScript :
_root.G = 0;
stop();
Código del fotograma 16 (linea principal).
Código ActionScript :
pages.gotoAndStop(_root.link);
if(pages._currentframe == 4){
pages.gallery.play();
}
Código del fotograma 17 (linea principal).
Código ActionScript :
pages._visible = 1;
Código del fotograma 18 (linea principal).
Código ActionScript :
_root.G = 0;
stop();
Código del botón dentro de MC menu_mc.
Código ActionScript :
on(rollOver){
if(_root.link != page){
gotoAndPlay("s1");
}
}
on(releaseOutside, rollOut){
if(_root.link != page){
gotoAndPlay("s2");
}
}
on(release){
if(_root.link != page && _root.G != 1){
if(_root.link == 4){
_parent.gotoAndPlay("s2");
}
_parent.gotoAndPlay("s1");
_root.G = 1;
_parent[("item" + _root.link)].gotoAndPlay("s2");
_root.link = page;
_root.gotoAndPlay("s1");
}
}
Código del archivo main.php.
Código :
//GALLERY
&stage_width=900&
&stage_height=600&
&gallery_width=500
&gallery_height=400
&preview_x_correction=1
&preview_y_correction=1
&preview_height_correction=-2
&preview_width_correction=-2
&zoom_x=20
&zoom_y=20
&menu_position=vertical&
&gallery_button__correction=0&
&page_back_correction=0;
&page_next_correction=0;
&comment_x_correction=0.0&
&comment_y_correction=3.0&
&comment_left=10
&comment_right=20
&menu_offset=-7.1&
&small_picture_x_correction=2&
&small_picture_y_correction=1&
&small_picture_height_correction=0&
&small_picture_width_correction=0&
&file_option=php&
&template_help_preview=false&
Código del archivo gallery.php.
Código :
&cat_0=TITULO 1 DEL MENU&
&cat_0_pic_0=pic00.jpg&
&cat_0_comment_0=COMENTARIO DE LA IMAGEN 1&
&cat_1=TITULO 2 DEL MENU&
&cat_1_pic_0=pic00.jpg&
&cat_2=TITULO 3 DEL MENU&
&cat_2_pic_0=pic00.jpg&
&cat_3=TITULO 4 DEL MENU&
&cat_3_pic_0=pic00.jpg&
&preview_position=left&
&preview_offset=14&
&image_width=61&
&image_height=61&
&h_space=14&
&v_space=14&
&colls=1&
&rows=1&
&listing_offset=8&
&open_in_browser=true&
&comment_position=stretched&
Estructura del MC pages.
En la capa Level1 capa se encuentra un MC llamado gallery(1)
Código del fotograma 1 (MC pages)
Código ActionScript :
stop();
Código del MC gallery(1).
Código ActionScript :
onClipEvent(load){
function check_loaded(){
if(_root.comment_position){
_parent.gallery.gotoAndStop(2);
}
}
if(!_root.comment_position){
loadVariablesNum(((_root.url + "_gallery.") + _root.file_option), 0);
_parent.gallery.stop();
intervalID = setInterval(check_loaded, 100);
}
}
Dentro del MC gallery encontramos la siguiente estructura.
En la capa Level 1 volvemos a encontrar un MC llamado nuevamente gallery(2).
Código del fotograma 1 y 2.
Código ActionScript :
stop();
Código del MC gallery(2).
Código ActionScript :
onClipEvent(load){
gallery_width = parseInt(_root.gallery_width);
gallery_height = parseInt(_root.gallery_height);
maxWidth = parseInt(_root.image_width);
maxHeight = parseInt(_root.image_height);
h_space = parseInt(_root.h_space);
v_space = parseInt(_root.v_space);
rows = parseInt(_root.rows);
colls = parseInt(_root.colls);
listing_offset = parseInt(_root.listing_offset);
listing_height = this.page_back_clip._height;
if(this.page_next_clip._height > listing_height){
listing_height = this.page_next_clip._height;
}
if(this.pages_listing._height > listing_height){
listing_height = this.pages_listing._height;
}
if(_root.preview_position == "left" || _root.preview_position == "right"){
y_offset = "false";
x_offset = "true";
x_position = _root.preview_position;
big_image_x_offset = parseInt(_root.preview_offset);
big_height = ((gallery_height - listing_height) - listing_offset) - big_image_x_offset;
big_width = ((gallery_width - colls * ((maxWidth + h_space))) + h_space) - big_image_x_offset;
rows = int(big_height / maxHeight);
v_space = (big_height - maxHeight * rows) / (rows - 1);
}
if(_root.preview_position == "top" || _root.preview_position == "bottom"){
y_offset = "true";
x_offset = "false";
y_position = _root.preview_position;
big_image_y_offset = parseInt(_root.preview_offset);
big_width = gallery_width;
big_height = ((((gallery_height - rows * ((maxHeight + v_space))) + v_space) - big_image_y_offset) - listing_height) - listing_offset;
colls = int(big_width / maxWidth);
h_space = (big_width - maxWidth * colls) / (colls - 1);
trace(h_space);
}
menu_position = _root.menu_position;
menu_offset = parseFloat(_root.menu_offset);
small_picture_bg_width_correction = parseInt(_root.small_picture_bg_width_correction);
small_picture_bg_height_correction = parseInt(_root.small_picture_bg_height_correction);
small_picture_pic_width_correction = parseInt(_root.small_picture_pic_width_correction);
small_picture_pic_height_correction = parseInt(_root.small_picture_pic_height_correction);
}
Por último dentro del MC gallery(2), encontramos una serie de elementos, que no nos afectan, lo importante son los primeros 2 fotogramas, con el siguiente código.
Código del fotograma 1 (Linea principal>pages>gallery(1)>gallery(2).
Código ActionScript :
if(!img_start){
img_start = 0;
}
var pic_names = new Array();
var category;
if(!_root.gallery_category){
category = 0;
} else if(_root.gallery_category){
category = _root.gallery_category;
}
listing_bg._visible = 0;
page_back_clip._visible = 0;
page_next_clip._visible = 0;
pages_listing._visible = 0;
preview._visible = 0;
big_image._visible = 0;
if(!_root.comment_position){
cats_buttons._visible = 0;
}
Código del fotograma 2 (Linea principal>pages>gallery(1)>gallery(2).
Código ActionScript :
if(!category){
category = 0;
}
if(colls == 0 || rows == 0){
stop();
}
var coll_position = 0;
var row_position = 0;
i = img_start;
while(i < (img_start + colls * rows)){
if(_root[((("cat_" + category) + "_pic_") + i)]){
this[("image" + i)].removeMovieClip();
duplicateMovieClip(preview.clip, [("image" + i)], i);
preview.clip._visible = 0;
preview[("image" + i)]._x = Math.round(((maxWidth + h_space)) * coll_position);
preview[("image" + i)]._y = Math.round(((maxHeight + v_space)) * row_position);
preview[("image" + i)].small_image_mask._width = maxWidth;
preview[("image" + i)].small_image_mask._height = maxHeight;
preview[("image" + i)].big_cont_bg._width = maxWidth;
preview[("image" + i)].big_cont_bg._height = maxHeight;
preview[("image" + i)].small_image_mask._x = parseFloat(_root.small_picture_x_correction);
preview[("image" + i)].small_image_mask._y = parseFloat(_root.small_picture_y_correction);
preview[("image" + i)].small_image_mask._width += parseFloat(_root.small_picture_width_correction);
preview[("image" + i)].small_image_mask._height += parseFloat(_root.small_picture_height_correction);
preview[("image" + i)].maxWidth = preview[("image" + i)].small_image_mask._width;
preview[("image" + i)].maxHeight = preview[("image" + i)].small_image_mask._height;
if(_root.template_help_preview != "true"){
preview[("image" + i)].small_pic_to_load = (_root[("cat_" + category)] + "/small/") + _root[((("cat_" + category) + "_pic_") + i)];
preview[("image" + i)].big_pic_to_load = (_root[("cat_" + category)] + "/big/") + _root[((("cat_" + category) + "_pic_") + i)];
}
if(_root.template_help_preview == "true"){
preview[("image" + i)].small_pic_to_load = (((_root.url + "_") + _root[("cat_" + category)]) + "_small_") + _root[((("cat_" + category) + "_pic_") + i)];
preview[("image" + i)].big_pic_to_load = (((_root.url + "_") + _root[("cat_" + category)]) + "_big_") + _root[((("cat_" + category) + "_pic_") + i)];
}
if(_root[((("cat_" + category) + "_comment_") + i)]){
preview[("image" + i)].picture_comment = _root[((("cat_" + category) + "_comment_") + i)];
}
preview[("image" + i)].category = _root[("cat_" + category)];
preview[("image" + i)].gotoAndPlay(2);
preview[("image" + i)].p1.small_picture_bg_width_correction = small_picture_bg_width_correction;
preview[("image" + i)].p1.small_picture_bg_height_correction = small_picture_bg_height_correction;
preview[("image" + i)].p1.small_picture_pic_width_correction = small_picture_pic_width_correction;
preview[("image" + i)].p1.small_picture_pic_height_correction = small_picture_pic_height_correction;
coll_position++;
if(coll_position == colls){
row_position++;
coll_position = 0;
}
if(row_position == rows){
row_position = 0;
}
}
i++;
}
if(!draw_menu){
but_height = parseInt(cats_buttons.category_but._height);
but_width = parseInt(cats_buttons.category_but._width);
but = 0;
while(_root[("cat_" + but)]){
cats_buttons.category_but._visible = 0;
duplicateMovieClip(cats_buttons.category_but, [("category_but" + but)], but);
if(menu_position == "vertical"){
cats_buttons[("category_but" + but)]._y = (but_height + menu_offset) * but;
}
if(menu_position == "horizontal"){
cats_buttons[("category_but" + but)]._x = (but_width + menu_offset) * but;
}
cats_buttons[("category_but" + but)].category = but;
cats_buttons[("category_but" + but)].button_text_animation.cats.text = _root[("cat_" + but)];
cats_buttons[("category_but" + but)].button_text_animation2.cats.text = _root[("cat_" + but)];
but++;
var draw_menu = true;
}
}
draw_pages = false;
if(draw_pages == false){
var k = 0;
k = 1;
while(pages_listing[("num" + k)]){
pages_listing[("num" + k)].removeMovieClip();
k++;
}
while(_root[((("cat_" + category) + "_pic_") + k)]){
k++;
}
pages_quant = k / (colls * rows);
var pages_num = parseInt(pages_quant);
if(parseInt(pages_quant) != pages_quant){
pages_num++;
}
k = 1;
while(k <= pages_num){
duplicateMovieClip(pages_listing.page_num, [("num" + k)], k);
pages_listing.page_num._visible = 0;
pages_listing[("num" + k)].number = (k - 1) * colls * rows;
pages_listing[("num" + k)].page_num_animation.page_text = k;
pages_listing[("num" + k)].page_num_animation.txt.autoSize = "left";
pages_listing[("num" + k)].hit._width = pages_listing[("num" + k)].page_num_animation.txt._width;
pages_listing[("num" + k)]._x = (pages_listing[("num" + k)]._width - 10) * k;
pages_listing[("num" + k)]._x += 10 * k;
k++;
}
}
var draw_pages = true;
if(pages_num == 1){
page_back_clip._visible = 0;
page_next_clip._visible = 0;
pages_listing._visible = 0;
listing_bg._visible = 0;
}
if(pages_num != 1){
page_back_clip._visible = 1;
page_next_clip._visible = 1;
pages_listing._visible = 1;
listing_bg._visible = 1;
}
if(y_offset == "true"){
if(y_position == "top"){
big_image._y = 0;
preview._y = big_height + big_image_y_offset;
}
if(y_position == "bottom"){
preview._y = 1;
big_image._y = big_image_y_offset + (rows * (maxHeight + v_space) - v_space);
}
}
if(x_offset == "true"){
if(x_position == "right"){
preview._x = 0;
big_image._x = (colls * (maxWidth + h_space) - h_space) + big_image_x_offset;
}
if(x_position == "left"){
big_image._x = 0;
preview._x = big_width + big_image_x_offset;
}
}
if(!c){
page_back_clip._y = gallery_height - page_back_clip._height;
pages_listing._y = gallery_height - pages_listing._height;
page_next_clip._y = gallery_height - page_next_clip._height;
page_back_clip._x = parseFloat(_root.page_back_correction);
page_next_clip._x = (gallery_width - page_next_clip._width) + parseFloat(_root.page_next_correction);
pages_listing._x = (gallery_width - pages_listing._width) / 2;
listing_bg._width = gallery_width - 2;
listing_bg._height = listing_height;
listing_bg._x = 1;
listing_bg._y = page_back_clip._y;
var c = true;
}
if(!resize_param){
big_image.big_image_mask._x += parseInt(_root.preview_x_correction);
big_image.big_image_mask._y += parseInt(_root.preview_y_correction);
big_image.big_image_mask._height = big_height + parseInt(_root.preview_height_correction);
big_image.big_image_mask._width = big_width + parseInt(_root.preview_width_correction);
var resize_param = "true";
}
big_image.big_cont_bg._height = big_image.big_image_mask._height;
big_image.big_cont_bg._width = big_image.big_image_mask._width;
big_image.zoom._x = parseInt(_root.zoom_x);
big_image.zoom._y = parseInt(_root.zoom_y);
if(_root.template_help_preview != "true"){
big_image.pic_to_load = (_root[("cat_" + category)] + "/big/") + _root[((("cat_" + category) + "_pic_") + img_start)];
}
if(_root.template_help_preview == "true"){
big_image.pic_to_load = (((_root.url + "_") + _root[("cat_" + category)]) + "_big_") + _root[((("cat_" + category) + "_pic_") + img_start)];
}
big_image.picture_comment = _root[((("cat_" + category) + "_comment_") + img_start)];
big_image.category = _root[("cat_" + category)];
big_image.play();
preview._visible = 1;
big_image._visible = 1;
if(pages_num != 1){
listing_bg._visible = 1;
page_back_clip._visible = 1;
page_next_clip._visible = 1;
pages_listing._visible = 1;
}
cats_buttons._visible = 1;
stop();
Uffffpor fin!!! siento el tostón, pero necesito un poco de ayuda para poder hacer funcionar la galería cargada externamente.
GRACIAS.