FORUMS: list search recent posts

Really in need of help on button action

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
drar
Really in need of help on button action
by
on Nov 19, 2006 at 5:55:32 am

I worte a message earlier but my problem still persists. I am going to be as detailed as possible. I have been trying to figure this out for over a week on my free time and I am just not sure what else to do.
ok here is the situation....
I have a movie clip that when clicked plays a sequence which tells it to roll and animate and such. The code is on an invisible button layer.
here is the code that is attached to it that works just fine (kinda long it is the first 3 lines I am focousing on):
on (release) {
getURL("http://chandrahope.com");
}


on (rollOver)
{
if (_root.link != 3)
{
gotoAndPlay(2);
} // end if
}
on (releaseOutside, rollOut)
{
if (_root.link != 3)
{
gotoAndPlay(21);
} // end if
}
on (release)
{
if (_root.link != 3)
{
_parent["but" + _root.link].gotoAndPlay("s2");
_root.link = 3;
} // end if
}

OK SO THIS ALL WORKS OK, BUT I WANT IT TO NOT GO TO A URL, I WANT IT TO GO TO A NEW SCENE WHEN CLICKED ON. SO I PUT THIS CODE IN:

on (release) {
gotoAndPlay("Scene 2", 1);
}




on (rollOver)
{
.............................everything else is the same as before

I tested this out on a simple button I created and it worked fine so there is nothing wrong with my scene 2. I just can't figure out why it works when I put in the code: on (release) {
getURL("http://chandrahope.com");
}
but not when I change it to: on (release) {
gotoAndPlay("Scene 2", 1);
}

I am super frustrated trying to figure this out. If you can't tell I am not really good with Flash, I actually purchased these already created buttons of istock photo web site, I figured it would be a simple code change to get them to work. I just do not know what I am doing wrong. Please if anyone can help me. I really have made an effort to figure it out on my own, I have called friends, flipped through books and searched online but I still can't get it. I can e-mail the file to someone if need be also.

thanks!!!!! Any help would be much appreciataed! :)





Return to posts index

Sher Ali
Re: Really in need of help on button action
on Nov 19, 2006 at 10:18:11 am

if the code is inside another movieclip not on the _root timeline then try this

on (release) {
_root.gotoAndPlay("Scene 2", 1);
}



Sher Ali
http://www.webeyestudio.com


Return to posts index

Sher Ali
Re: Really in need of help on button action
on Nov 19, 2006 at 10:22:05 am

I think you have scoping issues, the following code works because the getURl method is global method it has nothing to do with the scope from where you call it

on (release) {
getURL("http://chandrahope.com");
}

but if you have your code inside another movieclip then the following code will not work because it has the scope problem

on (release) {
gotoAndPlay("Scene 2", 1);
}

the correct code will be:

on (release) {
_root.gotoAndPlay("Scene 2", 1);
}


Sher Ali
http://www.webeyestudio.com


Return to posts index


drar
Re: Really in need of help on button action
by
on Nov 19, 2006 at 8:58:09 pm

thank you thank you!
I was still not able to get it to go to a new scene, not sure why, but I just changed it to go to a new frame number and that worked perfect. I really have no reason to need to go to a new scene anyhow, the most compley page will have a video on it but I don't believe I need a new scene for that. Thanks, I really appreciate the help!!! Now I shall continue my flash journey and read all anout video! :)
Aldo, thanks for your nice explanation, I really understand the reasoning now as to why my button did not work.

have a super day!



Return to posts index

drar
Re: Really in need of help on button action
by
on Nov 19, 2006 at 8:59:13 pm

sorry about all my bad typo's I am a terrible typer! :)


Return to posts index

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