Jump to content

Keep Getting Error Message Using Onrollover Actions Script ...


reflex84

Recommended Posts

Hi,I am trying to follow a tutorial TutVid has put on youtube.Please click this link

scroll to the time:12:33Here he is adding an actionScript ... I've added the exact actionscript he put there:
thumb1.onRollOver=function(){	 this._alpha=100;}thumb1.onRollOut=function(){	this._alpha=45;}

... BUT I get the following ERROR messages when I try "test movie" or "test scene":1119: Access of possibly undefined property onRollOver through a reference with static type flash.display:SimpleButton.and1119: Access of possibly undefined property onRollOut through a reference with static type flash.display:SimpleButton.I've tried googling the problem and fiddeling around with the code and I haven't come right!Some say its because of actionscript3 ... but what is the problem?Please could you let me know what I must replace this code with in order for it to work as I would really like to continue throught the rest of TUTVIDS tutorial!!Dale.

Link to comment
Share on other sites

ActionScript 3 is very different from ActionScript 2. The tutorial probably uses ActionScript 2, so you'll have to test your file with ActionScript 2.In ActionScript 3, you would have to write it something like this:

thumb1.addEventListener("rollover",function(){	 this._alpha=100;},false);

Link to comment
Share on other sites

ActionScript 3 is very different from ActionScript 2. The tutorial probably uses ActionScript 2, so you'll have to test your file with ActionScript 2.In ActionScript 3, you would have to write it something like this:
thumb1.addEventListener("rollover",function(){	 this._alpha=100;},false);

Hi,Thanks for your input and help here!I used your code above ..., ie, I put:thumb1.addEventListener("rollover",function(){ this._alpha=100;},false);thumb1.addEventListener("rollout",function(){ this._alpha=45;},false);and now I don't get any error messages but my rollover doesn't seem to work ... ??Any idea's why?I am VERY new at FLASH and I'm doing my best to follow that tutorial.ActionScript is also a bit "german" to me but I'm learning....
Link to comment
Share on other sites

I'm not exactly sure of the names and cases of the Flash events, since I don't use ActionScript often, but you can try other things to see if it works:"rollOver", "RollOver", "mouseOver", "mouseover"...But I really recommend that you change your ActionScript settings to make it run ActionScript 2 instead. You can set that in the publishing settings, I think. ActionScript 3 is a much more complex language than ActionScript 2. I'm not sure if thumb1 would even be referring to your movieclip or not in ActionScript 3.

Link to comment
Share on other sites

Ok, I've tried the variables you provided above "rollOver" ... etc and that didn't seem to work.I'm going to change settings to ActionsScript 2 in "publishing setting" now .. will I have to restart any work I had done for those settings to work?"thumb1" is an image I have that I want as a rollover. - I had converted it into a "button" symbol.I want the image to have a rollover effect and when click ... the enlarged version is displayed above (a photo gallery basically)Will get back to you in a bit...

Link to comment
Share on other sites

Hi,I've been following the tutorial some more and I've come across another problem but I think its got to do with the fact that now that I know the tutorial is written for ActionScript 3 - whereas if you read above, you will see that I had to turn my ActionScript settings to ActionScript 2.The ActionScript he provided was:

on(release){	photos_mc.gotoAndPlay("img1");}

What is the above ActionScript for ActionScript 2???Let me know, thanks guys!

Link to comment
Share on other sites

  • 1 year later...
Hi,I've been following the tutorial some more and I've come across another problem but I think its got to do with the fact that now that I know the tutorial is written for ActionScript 3 - whereas if you read above, you will see that I had to turn my ActionScript settings to ActionScript 2.The ActionScript he provided was:
on(release){	photos_mc.gotoAndPlay("img1");}

What is the above ActionScript for ActionScript 2???Let me know, thanks guys!

HELLO!I am brand new at flash, and have been doing the exact same tute. It has taken me 4 days to get the roll overs to work! agh!and now I have continued and the buttons don't work. ( when i click them the corresponding photo should appear and it doesn't.)I have set everything to action script 2.0, but I am working in CS4. This is the action script I have used on each thumbnail in the one motion clip layer. (as done in the tute.)on(release) { photosMC.gotoAndPlay("img1");} Please help me! I am determined not to give up!
Link to comment
Share on other sites

  • 1 month later...
HELLO!I am brand new at flash, and have been doing the exact same tute. It has taken me 4 days to get the roll overs to work! agh!and now I have continued and the buttons don't work. ( when i click them the corresponding photo should appear and it doesn't.)I have set everything to action script 2.0, but I am working in CS4. This is the action script I have used on each thumbnail in the one motion clip layer. (as done in the tute.)on(release) { photosMC.gotoAndPlay("img1");} Please help me! I am determined not to give up!
well you could make the photos invisble first by changing them transparent as below.Then make them visible //make the photos invisible. give them the appropriate names photo 1 and photo 2. photo1._alpha = 0;photo2._alpha =0;button1.onPress = function(){//make photo 1 visible//make photo 2 invisiblephoto1._alpha =100;photo2._alpha =0;}button2.onPress = function(){//make photo 1 invisible//make photo 2 visible//photo1._alpha =0;photo2._alpha =100;}
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...