Copy link to clipboard
Copied
in a picture gallery how do i make 2 pages of thumbnails contolled with a button to scroll between the pages ? i cant find a decent tutorial...
Cheers
The code from earlier that did include the photosMC instance name would appear to be the more correct based on what you have described. My guess is that there is something amiss in the instance naming. PArdon the repetition, but you'd be surprised how many people say they used the instance names after asking a couple of times and then it's found that they didn't use any. So just to be sure that's covered... the instance names are assigned in the properties panel, correct? They are not simply
...Copy link to clipboard
Copied
the same way you made one "page" of thumbnails.
Copy link to clipboard
Copied
they way i have created the gallery was to draw my master clip and have the thumbnails directly inside, then another movie clip which plays the images related to the thumbnail. So do i need to move my thumbnails inside thier own clip and then create another. Or is there i way i could draw them inside one clip have have some of them hidden and just offset the x value to show them to create a slding effect ?
Copy link to clipboard
Copied
duplicate your master clip using the remaining thumbnails.
Copy link to clipboard
Copied
okay sorry to keep asking, do i just then use action script on the next page button to call the 2nd master clip to be played
thanks for your help!
Dan
Copy link to clipboard
Copied
that depends on your setup. but you might do better to use the visible property of your master movieclips to reveal the pages.
Copy link to clipboard
Copied
okay what i have done is created another MC so my current structure is
MasterMC thats holds
PhotosMC
ThumbsMC
i will use a mask in the thumbsMC and _x to create my thumbnail pages.
in the thumbsMc i have my AS which to refernce the photos in the photosMC i have
thmb1_btn.addEventListener(MouseEvent.CLICK,onClick);
function onClick(event:MouseEvent):void{
if(event.target == thmb1_btn)
{
MovieClip(this.parent).photosMC.gotoAndPlay("image2");
trace("link")
}
i get this error TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MethodInfo-17()
when clicking on the thumbs, what am i missing here ?
Copy link to clipboard
Copied
click file/publish settings/flash and tick permit debugging. retest your app to see the line number causing the error message.
Copy link to clipboard
Copied
hello,
the line causing the problem is every line in the function that points the thumbs to the photos
MovieClip(this.parent).photosMC
i should be able to access the objects inside the photosMC clip this way shouldnt i?
thanks for your help
Copy link to clipboard
Copied
MasterMC thats holds
PhotosMC
ThumbsMC
You switched between caps and no caps for the mc instance names, so be sure your code agrees with the instance names that you assigned in the properties panel.
Copy link to clipboard
Copied
Hello Ned, thanks for your reply.
yea sorry it was a typeo when i listed it here, all my instance names are lower case with upper caseMC
so
masterMC
photosMC
thumbsMC
but the only one i reference in my code is photosMC, the messge from the debug on each thumb brings up an error that points to MovieClip(this.parent).photosMC.gotoAndPlay("image")
in theory should this be working?
this is my function
function onClick(event:MouseEvent):void{
if(event.target == thmb1_btn)
{
MovieClip (this.parent).photosMC.gotoAndPlay("image1");
trace("link")
}
}
and this code is in masterMC-thumbsMC
and the photosMc is in the masterMc
cheers
Copy link to clipboard
Copied
if that code is in thumbsMC and you want to direct photosMC timeline, use:
MovieClip(this.parent).gotoAndPlay("image");
Copy link to clipboard
Copied
thanks, still the same error its does not like that line of code?
Dam this is difficult!
So how does that work? as pointing to the parent from thumbsMc takes us to masterMC which has the photosMc.
Can we access whats inside the photosMc from masterMc with out directly naming it in the code.
i hope that question makes sense lol
thank you for your time
Copy link to clipboard
Copied
case counts in flash. and it's very confusing trying to help someone that's careless.
so, if it's thumbsMC and not thumbsMc or vice-versa, be consistant and accurate. recheck all three instance names and recheck the typing in your actions panel.
Copy link to clipboard
Copied
Sorry late night last night. Every instance name is instanceMC. I am just missing that I am typing it wrong here which obviously does not make helping me easy sorry!
I have checked all the instance names and they are all the same, the current code following Neds advice does not use any of the instance names.
{
MovieClip(this.parent).gotoAndPlay("image");
}
That function is written inside thumbsMC, the images to be played are inside photosMC.Both movie clips thumbsMC and photosMC are inside masterMC,masterMC sits on the main timeline.
Thanks
Copy link to clipboard
Copied
The code from earlier that did include the photosMC instance name would appear to be the more correct based on what you have described. My guess is that there is something amiss in the instance naming. PArdon the repetition, but you'd be surprised how many people say they used the instance names after asking a couple of times and then it's found that they didn't use any. So just to be sure that's covered... the instance names are assigned in the properties panel, correct? They are not simply the names you've used in the library, correct?
IF that's all correct, then is there any kind of timeline transition of the photosMC before it comes into play? If so, be sure each end of the transition holds the instance name.
Copy link to clipboard
Copied
Hi Ned, i have named the instances in the property panel the first white field available, it is not just the names I have given the movie clips.
timeline transition? what do you mean? The first frame in photosMC has a stop(); and each image has a label which i correspond to the function.The last frame in the movie clip i have a gotoAndPlay("image1").
This was all working fine as it should before i wanted to create two pages of thumbnails. I placed all the thumbnails and the AS in their own MC thumbsMC.
So i thought that changing the function that has been moved from inside masterMC to thumbsMC
From photosMC.gotoAndPlay to MovieClip(this.parent)photosMC.gotoAndPlay would make it work as we are now one level deeper and need to refer back to the clip in the parent ?
Thanks
Copy link to clipboard
Copied
By a timeline transition of the photosMC I mean if it is faded in or maybe moved onto the stage as part of setting up, not within itself, but as an object in its parent timeline.
What you explain as far as your changes sounds right, so I can't deduce anything from it as being wrong. If you are still having a problem, try to find some way of making your fla file available online. There are some free services that support doing this, I just don't know any by name offhand.
Copy link to clipboard
Copied
thanks Ned i could up load it to mydomain?
Copy link to clipboard
Copied
Yes, if you have your own domain, that's a good place to upload the fla. Just provide a link to it and someone could take a look.
Copy link to clipboard
Copied
If this is your setup:
masterMC
- photosMC
- thumbsMC
then thumbsMC should never (have to) access photosMC.
It should dispatch an event to which masterMC listens.
masterMC then does whatever needs to be done (like telling photosMC to do something).
Copy link to clipboard
Copied
so MovieClip(this.parent).gotoAndPlay
from within thumbsMC would access photosMC as wanted
cheers
Copy link to clipboard
Copied
http://www.simply-simple.co.uk/Surrey-florist-gallery3.fla
here is a link
cheers
Copy link to clipboard
Copied
I don't have CS4, so someone who does have it will hopefully come along and give it a look. If no one shows up, if you save it as CS3 I can take a look.
Copy link to clipboard
Copied
Doh, lack of sleep is getting to me now i think i am going to git the pillow.
As you kindly advised earlier today you cant see a problem with the way in which i have explained my method of codeing, i think im just going to except somthing is maybe currupt and start again.
thanks for your support , i have put a new file up for cs3 if you get a mo
thanks
dan
http://www.simply-simple.co.uk/Surrey-florist-gallerycs3.fla