FORUMS: list search recent posts

vertical scroll

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
bogdan Oancea
vertical scroll
on Jul 23, 2008 at 7:42:47 pm

I was wondering if you could help me with a tutorial. I want to create this effect http://www.oman3d.com/tutorials/flash/imagegallery/ . I want to create a menu with text and picture, about the size of those thumbnails. But i want tot create the effect on vertical. so the scroll of the menu is on vertical.



Return to posts index

Pieter Helsen
Re: vertical scroll
on Jul 23, 2008 at 7:46:58 pm

Change _x for _y and _width for _height...?

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 23, 2008 at 7:51:33 pm

i tried that, it worked, but the scroll would not stop, i mean the buttons keep going down or up. they dont stop when they ar at the end like in that minisliding. all the buttons dissapear, the eather go totally up or down



Return to posts index


Pieter Helsen
Re: vertical scroll
on Jul 23, 2008 at 8:03:31 pm


container.onEnterFrame = function() {
if (scrolling) {
this._y += Math.cos((-_root._ymouse/Stage.height)*Math.PI)*15;
if (this._y>0) {
this._y = 0;
}
if (-this._y>(this._height-Stage.height)) {
this._y = -(this._height-Stage.height);
}
}
};

Clearly you missed on. It works for me.

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 23, 2008 at 8:51:25 pm

yeah it's true, my fault but i still get a little "bug". I have 4 buttons, and i want them to be one unde another. the problem is that the first 3 are one under another, but the last one is at about 20px away from the last button. and i want to make the button to redirect the user that clickes it to another page. not like in the tutorial make the picure on the hole page.



Return to posts index

Pieter Helsen
Re: vertical scroll
on Jul 23, 2008 at 9:06:58 pm

Are all your thumbnails equally sized?

scrolling = false;
_root.attachMovie("image"+this.largerImage,"large_mc",2);
large_mc._x = (Stage.width-large_mc._width)/2;
large_mc._y = (Stage.height-large_mc._height)/2;
new Tween(large_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
new Tween(container, "_alpha", Strong.easeOut, 100, 50, 0.5, true);
large_mc.onRelease = function() {
this.enabled=false;
scrolling = true;
var myFadeOut = new Tween(large_mc, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
new Tween(container, "_alpha", Strong.easeOut, 50, 100, 0.5, true);
myFadeOut.onMotionFinished = function() {
for (i=1; i<=imagesNumber; i++) {
var myClip = container["thumb"+i+"_mc"];
myClip.enabled = true;
}
large_mc.removeMovieClip();
};
};

This is the part that makes the button bigger.
Replace that with a getURL command to go to another page.


Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index


bogdan Oancea
Re: vertical scroll
on Jul 23, 2008 at 9:31:33 pm

Thank you very much. you've been so helpful



Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 24, 2008 at 11:19:15 am

it doesn't work.... the getURL. I mean it only works for the last picture. here is the code:

this.createEmptyMovieClip("container",1);

var imagesNumber:Number = 9;
for (i=1; i<=imagesNumber; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
myThumb_mc = container["thumb"+i+"_mc"];
myThumb_mc._y = (i-1)*myThumb_mc._width;
myThumb_mc._x = (Stage.height-myThumb_mc._height)/2
}

container.onEnterFrame = function() {
this._y += Math.cos((-_root._ymouse/Stage.height)*Math.PI)*15;
if (this._y>0) {
this._y = 0;
}
if (-this._y>(this._height-Stage.height)) {
this._y = -(this._height-Stage.height);
}
};

myThumb4_mc.onRelease=function(){
getURL("http://www.tutorial5.com/", "_blank");

}

myThumb_mc.onRelease=function(){
getURL("http://www.google.com", "_blank");
}


so if i leav it to "myThumb_mc" it works for the last picture only but if i try to add "myThumb2_mc" for exemple it does'n work... why??



Return to posts index

Pieter Helsen
Re: vertical scroll
on Jul 24, 2008 at 11:28:55 am

Add what's in bold

this.createEmptyMovieClip("container",1);

var imagesNumber:Number = 9;
var urlArray:Array = new Array("http://www.tutorial5.com", "http://www.google.com");



myThumb_mc = container["thumb"+i+"_mc"];
// This adds a variable to the movieclip.
// That variable (_url) contains the URL from the array above.
myThumb_mc._url = urlArray[i];
myThumb_mc._y = (i-1)*myThumb_mc._width;
myThumb_mc._x = (Stage.height-myThumb_mc._height)/2


Now add a getURL that takes that _url variable

myThumb_mc.onRelease=function(){
getURL(this._url, "_blank");
}


Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index


bogdan Oancea
Re: vertical scroll
on Jul 24, 2008 at 11:46:34 am

still the same problem, i don't get how i should add getURL to the other pictures. i replaced the "getURL(http://www.google.ro, "_blank");"

and when i pres it it says that "page error ......../.../prototype/undefined" the dots are for C:doc etc



Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 24, 2008 at 11:23:07 pm

pls help me on this. it's the last thing i need :D just to know how to give each button an individual page to access

this is the code this far:

this.createEmptyMovieClip("container",1);

var imagesNumber:Number = 10;
var urlArray:Array = new Array("http://www.hi5.com", "http://www.google.com");
for (i=1; i<=imagesNumber; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
myThumb_mc = container["thumb"+i+"_mc"];
// This adds a variable to the movieclip.

// That variable (_url) contains the URL from the array above.

myThumb_mc._url = urlArray[i];
myThumb_mc._y = (i-1)*myThumb_mc._height;
myThumb_mc._x = (Stage.width-myThumb_mc._width)/2
}

container.onEnterFrame = function() {
this._y += Math.cos((-_root._ymouse/Stage.height)*Math.PI)*15;
if (this._y>0) {
this._y = 0;
}
if (-this._y>(this._height-Stage.height)) {
this._y = -(this._height-Stage.height);
}
};

myThumb_mc.onRelease=function(){

getURL(this._url, "_blank");

}



i tried putting instead of getURL(this._url, "_blank"); i put getURL(this._http://www.google.com, "_blank"); and this too getURL(http://www.google.com, "_blank"); it did not work and also i duplicated from myTbumb_mc.onRelease with myThumb1.. did not work



Return to posts index

Pieter Helsen
Re: vertical scroll
on Jul 25, 2008 at 12:00:20 am


//Paste this code at the top of your existing code to be able to use the Tween Class

import mx.transitions.Tween;
import mx.transitions.easing.*;

this.createEmptyMovieClip("container",1);

var imagesNumber:Number = 10;
var urlArray:Array = new Array("", "http://www.firstPage.com", "http://www.secondPage.com", "http://www.andSoOn.com");

for (i=1; i<=imagesNumber; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
myThumb_mc = container["thumb"+i+"_mc"];
// This adds a variable to the movieclip.

// That variable (_url) contains the URL from the array above.
myThumb_mc._link = urlArray[i];
myThumb_mc._y = (i-1)*myThumb_mc._height;
myThumb_mc._x = (Stage.width-myThumb_mc._width)/2;
myThumb_mc.onRelease = function() {
getURL(this._link);
};
}

container.onEnterFrame = function() {
this._y += Math.cos((-_root._ymouse/Stage.height)*Math.PI)*15;
if (this._y>0) {
this._y = 0;
}
if (-this._y>(this._height-Stage.height)) {
this._y = -(this._height-Stage.height);
}
};


Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index


bogdan Oancea
Re: vertical scroll
on Jul 25, 2008 at 12:11:00 am

and "var urlArray:Array = new Array("", "http://www.firstPage.com", "http://www.secondPage.com", "http://www.andSoOn.com");"
i put the url in the order of the buttons, i mean if the first button is home, i put in new Array "home.html first right, and so on.. if contact is the 4-th i put the contact.html the 4-th??



Return to posts index

Pieter Helsen
Re: vertical scroll
on Jul 25, 2008 at 12:14:23 am

Yup, pretty much :p

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 25, 2008 at 12:18:24 am

thx you really know you're AS :P could you recommand me a learning tutorial or a book or something, i sawu began u're flash at the age of 15... i am 17 and i want to learn flash php and html. I know the basic of html and php .... flash=0 :P so could you tell me, give me an advice on how toget better at them??.... anywhoom.. thanks a bunch >:D<

u're the best



Return to posts index


Pieter Helsen
Re: vertical scroll
on Jul 25, 2008 at 12:32:29 am

Well, I learned most of it by doing, reading tutorials and browsing forums. There are a few good books though.

Essential Actionscript 3 is one of them. (I have the one for AS2 though :))

As far as PHP goes, it's a pretty easy language with an awesome help website. (http://www.php.net) Getting the hang of PHP shouldn't be too hard.

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 25, 2008 at 12:51:47 am

u're the best thx



Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 25, 2008 at 1:11:40 am

oke so this is killing me :) the first link i put is index.html and the secont a gif picture like this
new Array("index.html", "image.gif");
and it gives me this message

Not Found

The requested URL /x/undefined was not found on this server.

in x folder is located index.html .. i've also tried to put the link like this "./index.html" doesn't work at all



Return to posts index

Pieter Helsen
Re: vertical scroll
on Jul 25, 2008 at 1:15:15 am

Arrays start counting at 0, your for loop starts counting at 1, that's why I put an empty value as the first value of the array.

new Array("", "index.html", "image.gif", ...);

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

bogdan Oancea
Re: vertical scroll
on Jul 25, 2008 at 1:32:34 am

yeah... it wasn't that... the "" were there.. in my own dumb-stupid-hurry i forgot to put ; after "width)/2" :P

anyway thx for all u're help



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]