-
[F8] accessing a movie clip thats been attached
Hello...
So I need some help. I have a photo gallery menu. It has 4 options. Each option contains a different amount of photos. I have a dynamic text box that shows the number of photos for that menu option and buttons that are SUPPOSED to advance the photos. I've grouped all these (the text field and buttons) into one movie clip. I want that movie clip to attach itself to each menu option upon the menu option being clicked. It attaches fine. The number of photos for the menu display correctly but the buttons (which are really movieclips with a _btn extension) don't work! I could really use a fresh pair of eyes. I am inserting what I have for this.
I've labled the linkage of the movieclip properly, as "navi." Everything is spelled right, I just don't get it. ...and like i said the dynamic text field is showing properly, so not sure why the same target isn't working for the buttons. Thanks in advance.
pos_txt = the dynamic text field
next_btn = the movieclip thats supposed to advance the gallery
previous_btn = the mc thats supposed to go backward in the gallery
onEnterFrame = function(){
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}
photography_mc.nav_mc.previous_btn.onRelease = function() {
prevImage();
}
photography_mc.nav_mc.next_btn.onRelease = function() {
nextImage();
}
function picture_num() {
current_pos = p+1;
photography_mc.nav_mc.pos_txt.text = current_pos+" / "+total;
}
function nextImage() {
if (p<(total-1)) {
p++;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
photo_mc.loadPhoto(image[0]);
desc_txt.text = description[p];
picture_num();
}
-
FK'n_dog
Code:
onEnterFrame = function(){
// this is happening continuously at FPS setting of movie
// if FPS = 30, nav_mc is attached 30 times a second
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}
///////////////////////////////////////////////////////////
// try a different approach -
init = function(){
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}
init();
///////////////////////////////////////////////////////////
// has this helped ??
-
no change...
it still attaches just fine and the text field is working, but the buttons are not.
-
FK'n_dog
run your file - Test Movie
look at how your paths are compiled - List Variables
is - photography_mc.nav_mc.next_btn - a viable variable ?
-
huh? viable variable? i am confused now.
-
FK'n_dog
don't be confused - use List Variables
is the path you require in there
if not, your logic is flawed
-
how do I list these variables? I don't know why it wouldnt be viable because the pos_txt is in the same location as the previous and next "btns" and it works. Maybe I should upload a file?
-
FK'n_dog
how do I list these variables?
Test Movie - keyboard shortcut - Ctrl / Enter
List Variables - keyboard shortcut - Ctrl / Alt / V
out of interest - what is loadPhoto ?
is this a function call ? or something new to Flash 8 ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|