Groups | Blog | Home
all groups > flash actionscript > september 2006 >

flash actionscript : More confusing than the Matrix


sheep-ish
9/24/2006 11:48:26 PM
I am creating a website that has a scrolling panel of thumbnails, and I'm
trying to make it so that when you click on a thumb, you go to a new window
with a larger version of the image in it.

Everything is working apart from the thumb_12 action. I have treated it the
same as the links at the bottom of the page (they work fine), but this isn't.
Is it because it's in a scrolling panel?

I'm new to all of this, so any help would be great.

Dave



panel.onRollOver = panelOver;

function panelOver(){
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}

var b = stroke.getBounds(_root);

function scrollPanel(){
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax){
this.onRollOver = panelOver;
delete this.onEnterFrame;
}

var xdist = _xmouse - 400;
panel._x += -xdist / 7;

if(panel._x >= 54){
panel._x = 54;

}
if(panel._x <= -921){
panel._x = -921;
}
}


freerange.onRollOver = over;
freerange.onRollOut = out;
freerange.onRelease = go_one;

homenav.onRollOver = over;
homenav.onRollOut = out;
homenav.onRelease = go_two;

contactus.onRollOver = over;
contactus.onRollOut = out;
contactus.onRelease = go_three;

thumb_12.onRelease = twelve;

function over() {
this.gotoAndPlay(2);
}

function out() {
this.gotoAndPlay(8);
}

function go_one() {
getURL("http://www.theroost.co.nz/free_range.html");
}

function go_two() {
getURL("http://www.theroost.co.nz/homepage.html");
}

function go_three() {
getURL("http://www.theroost.co.nz/contact.html");
}

function twelve(){
getURL("http://www.dimentia.co.nz");
}
coldMiner
9/25/2006 12:55:40 AM
Maybe it is a path problem?
Is thumb_12 inside the movieClip "panel"?
if so, then the correct code is:
sheep-ish
9/25/2006 1:09:39 AM
I thought you had it there!

You're right in that the thumb_12 button is inside the movieClip "panel" so
you're code makes sense, but unfortunately it doesn't work.

Do you know if I have it in the right location within the code?
coldMiner
9/25/2006 1:17:24 AM
If thumb_12 is a pictureholder, lets say you load å jpg inside it:
thumb_12.loadMovie("thumb12.jpg);
you destroy the onRelease action.
You must put the onRelease action after the picture is loaded.

If not make sure that thumb_12 exist when you put the onRelease code to it.
if you have the onRelease code in frame 1, and thumb_12 enters the stage in
frame 2,
then it have no onRelease action...
sheep-ish
9/25/2006 1:42:54 AM
Thanks for the reply ColdMiner. The page in question is

http://www.theroost.co.nz/picture_this.html

The whole page is only one frame long, with movie clips for each animation on
individual layers, as well as an action layer.

thumb_12 is only one of the images (once I get this cracked I will apply it to
the other 11 images).

As the movieclip "panel" is always on, I though that the individual buttons
contained in it would always be available for instruction. Is this not the case?
coldMiner
9/25/2006 2:05:39 AM
Sounds weird...
But first of all, you'r thumbs in the panel are not MovieClips but buttons,
but then again that should be ok...
Are you sure that you have named thumb_12....

Try putting this code directly on the thumb_12 movieclip (just for testing):
on(release){
trace("Who: "+this+" | Name:"+this._name);
}
// u have to select the thumb_12 moviclip, and enter the code in the
// actionscript panel
sheep-ish
9/25/2006 8:18:40 PM
You were right coldMiner, while 'thumb_12' was called 'thumb_12' I hadn't given
it an instance name of 'thumb_12'.

DOH!!

Now your original comment of 'panel.thumb_12.....' works perfectly (and the
house keeping comments nice as well)

Thanks for your patience.

Now to make the new window a cetain size with no scrollbars etc. Any tips?
coldMiner
9/26/2006 4:37:13 PM
Why pop-up?
Load the high resolution image in the Flashmovie.

With your JavaScript the picture pop-up in a little window on my monitor
on the left - while I'm looking at your website on my monitor on the right.
Not an elegant solution...
sheep-ish
9/26/2006 11:23:01 PM
Your'e right it isn't very elegant. I'm going to get this version of the site
up and running, and then go back and refine it - possibly altering the design
of the page to incorporate the larger images.

This has been my first real experience with flash, so it has just been one big
learning curve.

Dave
AddThis Social Bookmark Button