Copy link to clipboard
Copied
HI,
I'm new to these forums, but have some experience in Flash. I am no guru, but I can hold my own with some of the more basic concepts.
I have this site...http://www.lealaselina.com
If you check the portfolio page, the page numbers are populated by an xml file. The only problem is that it runs off the bottom of the page and looks sloppy. I am hoping to add a button for Page 1, Page 2, etc. Maybe loaded from separate xml files. I am open to any suggestions to do it another way as well. Perhaps making that photo list scrollable so it is only viewable within a certain area. If anyone has some pointers, I'd be all ears!
Thanks in advance and if you need more info, please let me know!
Justin
Copy link to clipboard
Copied
I would make the thumbnails scrollable. No logic in creating the pages unless for example they are grouped in different categories.
Copy link to clipboard
Copied
If I copy and paste some code here, would you be able to help me modify it to be scrollable within an area? I am no good with scrolling. I had some help with the ActionScript already
Copy link to clipboard
Copied
Sure, but use the bare bones example - do not post code for the entire project please
Copy link to clipboard
Copied
I think this is the code for the loading of thumbnails and the thumbnail groups, ie. page 1-23 on the right hand side that I wish to have within a scrollable area, that perhaps cuts off at 20 items so it doesn't bleed onto the bottom of the template.
Thanks in advance!
import mx.transitions.Tween;
import mx.transitions.easing.*;
item_number_group.item_number._visible = false;
tn_group.tn._visible = false;
tn_group.setMask(tn_group_area);
var fm_show_no:Number = 3;// number of thumbnails showing at a time
var total:Number = filename_list.length;
var total_page:Number = Math.ceil(total / fm_show_no);
var distance:Number = tn_group.tn._height + 10;
var i:Number = 0;
var start_from:Number = 0;
var current:Number = 0;
var effect_duration:Number = 0.6;
fm_title.text = "";
fm_description.text = "";
flashmo_pic_button.useHandCursor = false;
for (; i < total; i++) // create thumbnail items
{
var fm_tn = tn_group.tn.duplicateMovieClip("tn" + i, i);
fm_tn.preloader._width = 0;
fm_tn.tn_button._visible = false;
fm_tn.txt = (i + 1);
fm_tn.tn_no = i;
fm_tn._y = i * distance;
fm_tn.tn_button.onRelease = function()
{
unload_pic(this._parent.tn_no);
};
}
for( p = 0; p < total_page; p++ ) // create page numbers
{
var mi = item_number_group.item_number.duplicateMovieClip("item_number" + p, p);
mi.over = true;
mi.item_label = p + 1;
mi.item_no = p;
mi._y = p * 25;
mi.over = true;
mi.flashmo_button.onRollOver = function()
{
this._parent.over = false;
};
mi.flashmo_button.onRollOut = mi.flashmo_button.onDragOut = function ()
{
this._parent.over = true;
};
mi.flashmo_button.onRelease = function()
{
start_from = this._parent.item_no * fm_show_no;
move_it();
};
mi.onEnterFrame = function()
{
if (this.over == true)
this.prevFrame();
else
this.nextFrame();
};
}
function move_it()
{
if (Math.ceil(total - start_from) <= fm_show_no)
{
start_from = total - fm_show_no;
}
if (start_from < fm_show_no - 1)
{
start_from = 0;
}
for( p = 0; p < total_page; p++ )
{
item_number_group["item_number" + p].flashmo_button.enabled = true;
item_number_group["item_number" + p].over = true;
}
page_no = Math.ceil( start_from / fm_show_no);
item_number_group["item_number" + page_no].flashmo_button.enabled = false;
item_number_group["item_number" + page_no].over= false;
position_x = start_from * distance - tn_group_area._y - 1;
new Tween(tn_group, "_y", Strong.easeInOut, tn_group._y, -position_x, 1.2, true);
}
fm_previous.onRelease = function()
{
start_from -= fm_show_no;
move_it();
};
fm_next.onRelease = function()
{
start_from += fm_show_no;
move_it();
};
move_it();
Mouse.addListener(item_number_group);
item_number_group.onMouseWheel = function(w)
{
if( w > 0 )
start_from -= fm_show_no;
else
start_from += fm_show_no;
move_it();
}
function unload_pic(fm_selected_pic_no)
{
flashmo_pic_button.enabled = false;
for ( i = 0; i < total; i++)
{
var fm_tn = tn_group["tn" + i];
fm_tn.tn_button.enabled = false;
}
var fm_tween = new Tween(flashmo_pic_holder, "_alpha", Regular.easeIn, 100, 0, effect_duration, true);
fm_tween.onMotionFinished = function()
{
load_pic(fm_selected_pic_no);
}
}
load_pic(0); // load the first one
function load_pic(fm_selected_pic_no)
{
flashmo_pic_button.onRollOver = function()
{
fm_title.text = title_list[fm_selected_pic_no];
fm_description.text = description_list[fm_selected_pic_no];
}
flashmo_pic_button.onRollOut = function()
{
fm_title.text = "";
fm_description.text = "";
}
flashmo_pic_button.onRelease = function()
{
getURL( url_list[fm_selected_pic_no], url_target_list[fm_selected_pic_no] );
}
flashmo_pic_holder.loadMovie( filepath + filename_list[fm_selected_pic_no] );
preloader.onEnterFrame = function()
{
var bytes_loaded:Number = flashmo_pic_holder.getBytesLoaded();
var bytes_total:Number = flashmo_pic_holder.getBytesTotal();
var percent:Number = 0;
if ( bytes_total != undefined )
{
percent = Math.round( bytes_loaded / bytes_total * 100 );
}
if( percent > 1 )
{
preloader._width = 0;
preloader._visible = preloader_bg._visible = true;
preloader._width = percent * preloader_bg._width * 0.01;
loading_info.text = percent + "%";
}
if( percent == 100 )
{
loading_info.text = "";
preloader._visible = preloader_bg._visible = false;
delete this.onEnterFrame;
var fm_tween = new Tween(flashmo_pic_holder, "_alpha", Regular.easeOut, 0, 100, effect_duration, true);
fm_tween.onMotionFinished = function()
{
flashmo_pic_button.enabled = true;
for ( i = 0; i < total; i++)
{
var fm_tn = tn_group["tn" + i];
fm_tn.tn_button.enabled = true;
}
}
}
}
}
Copy link to clipboard
Copied
The code is AS2 so please post your questions in AS1/2 forum!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now