PDA

View Full Version : roll overs actionscript in flash help plz :)



Icehawk
August 7th, 2005, 06:50 PM
read and look at the image plz tell me whats wrong :(
http://i12.photobucket.com/albums/a218/foggythefox/helproll.gif

Icehawk
August 7th, 2005, 06:54 PM
nvm i fixed it lol

System-Idle
August 7th, 2005, 07:02 PM
just use gotoAndStop()

btn_mc.onRollOver = function()
{
this.gotoAndStop(2);
}

btn_mc.onRollOut = function()
{
this.gotoAndStop(1);
}

Icehawk
August 7th, 2005, 07:32 PM
helppppppppppp
either 1 works for the movie but here is my problem
the roll overs work now but
i need it also to link to frame 3 which has the content on it ....
i put the third frame and once i click frame 3 shows up GOOD :) but then when i release it goes back 2 frame 1 how do i make it stay in frame 3

System-Idle
August 7th, 2005, 07:41 PM
remove yr onRelease function :)

Icehawk
August 7th, 2005, 07:46 PM
hmm i didnt end up using release lol
i just needed roll over

Icehawk
August 7th, 2005, 07:53 PM
nvm i found antoher solution maybe

Icehawk
August 7th, 2005, 07:58 PM
ok that was a definate maybe it wont work because its text only in need images
does ne 1 know how 2 make text link to a diffrent frame and stop at that frame? because its not a symbol so i cant use action script... ?

cryo.burned
August 8th, 2005, 12:12 AM
ok that was a definate maybe it wont work because its text only in need images
does ne 1 know how 2 make text link to a diffrent frame and stop at that frame? because its not a symbol so i cant use action script... ?

I say just convert it to a symbol.. or MAYBE (whats with these maybes)render all text in a box as HTML, make it link externally and then have the redirected page link to the desired frame.. dont know if its possible, but it sounds nifty doesn't it?

fiddleDev
August 8th, 2005, 01:52 AM
try this,
create a movieclip that contains any shape you wish. then paste thiis script.

onClipEvent(load){

div=8;
this.onRollOver = function(){
endA=[any value you wish, int]; // this isthe alpha when you hover over it
endX=[any value you wish, int]; // this is the x coordinate when you
// hover over it, don't give a large value
}
this.onRollOver = function(){
endA=[any value you wish, int];
endX=[any value you wish, int];
}
}
onClipEvent(enterFrame){
_alpha+=(endA-_alpha)/div;
_x+=(endX-_x)/div;
}
pm me if you want to ask questions.

Icehawk
August 8th, 2005, 11:26 PM
im confused right there....
ok i got it so roll over works
i also got it to go 2 the frame when i click
but as soon as i stop clicking the frame goes away .... how do i fix this
im using this code
frame 1 is normal
frame 2 is the rollover image
frame 3 is the text/pictures

btn_mc.onRollOver = function()
{
this.gotoAndStop(2);
}

btn_mc.onRollOut = function()
{
this.gotoAndStop(1);
}

btn_mc.press = function()
{
this.gotoAndStop(3);
}

Krilnon
August 9th, 2005, 12:21 AM
I would try changing 'btn_mc.press' to 'btn_mc.release', if I correctly understand what you're trying to do.

System-Idle
August 9th, 2005, 07:05 AM
I think its best if you separate yr btns from yr content.

Have a look at the attached file to see some simple btn examples.

one is a movieclip acting as a btn and the other is a btn.

see how the rollover states work for both and how the actionscript can control the movieclips. take note of the dot notation to target movieclips you want to control.

Icehawk
August 9th, 2005, 02:06 PM
ok that helps explain tons ty :)
but
it doesnt work...
i changed everything so is exaclty like urs hmmm

btn.onRelease = function() {
_level0.content.gotoAndStop('page1');

i just dont understand what _level0 is do i need to change somthing in the movie to _level0 ?

System-Idle
August 9th, 2005, 06:37 PM
when working with a single swf _level0 is the same as _root

when loading multiple swfs _level0 is the bottom most swf, where _root is the lowest level in that a perticular swf.

make sure you publish settings are set to flash player 6.

the code works fine in the prev attached fla, use and adapt the elements in yr project

Icehawk
August 9th, 2005, 09:07 PM
i changed it 2 flash player 6 and it works WOOT
ty all u guys all rock

Icehawk
August 13th, 2005, 02:16 AM
ok i got the menus all working
i have text in the content woot :)
what code and where would i put it if i wanted to link text in content to another page in content

i tried
bak. is the back text and it should to page 5... but it doesnt work

bak.onRelease = function() {
_level0.content.gotoAndStop('page5');
};
also where do i put action in content or no ?? ...
help im so confused lol im 1/4 thru flash book

System-Idle
August 13th, 2005, 07:46 AM
google is a great source with links to a welth of information. I suggest you read up on the areas of flash you want to use

working with multiple levels in flash
working with multiple movieclip
controling movieclips with buttons etc

try here http://www.google.co.uk/search?hl=en&q=working+with+multiple+levels+in+flash&meta=