PDA

View Full Version : 1119: Access of possibly undefined property onRollOver...


smarttart62
07-06-2007, 12:55 AM
I haven't touched Flash since MX 2004 and it's like a whole new learning expirience.

I'm about to stab someone in the eye, so i'd appreciate if someone could help me with the following error:
1119: Access of possibly undefined property onRollOver through a reference with static type flash.display:SimpleButton.

I have a button named btMail and made the code (in a frame):
btMail.onRollOver=function(){
// btGlass.x-=100;
gotoAndStop(5);
}

So that when it rolls over it should change the position of another button. I tried using the first commented code that in my book should have done the trick (also tried it with a root) and it didn't work. So i figured i'd just make a new frame and change the positions to my liking... Still doesn't work, and i get that damn error code... Aparently i can't just put that code in a button anymore? Well i thought i could apply actions to a button, but i guess not...

Anyways, can someone please help me find the error in my code?
Thanks,
-Steve

smarttart62
07-06-2007, 12:16 PM
Any takers?
-Steve

dr_zeus
07-06-2007, 05:05 PM
You said you're using Flash MX 2004, but because you posted in the Flash 9 forum, I assume you mean Flash CS3. I'm also going to assume that you're trying to use ActionScript 3. I recommend checking your details before posting next time, and please correct me if I've assumed anything wrong.

The problem is that onRollOver no longer exists in ActionScript 3. You need to listen for the ROLL_OVER event and call a seperate function now.

btMail.addEventListener(MouseEvent.ROLL_OVER, onRollOver);

function onRollOver():void
{
// btGlass.x-=100;
gotoAndStop(5);
}

smarttart62
07-06-2007, 05:56 PM
I said i haven't used it since 2004, and thanks so much for the code but i get this now:

Warning: 1090: Migration issue: The onRollOver event handler is not triggered automatically by Flash Player at run time in ActionScript 3.0. You must first register this handler for the event using addEventListener ( 'mouseOver', callback_handler).

I'll see if i can solve it myself, but i doubt it...
-Steve

smarttart62
07-06-2007, 06:00 PM
Got it.

Thanks so much for the help, just had to rename the function ^_^.
-Steve

dr_zeus
07-06-2007, 07:50 PM
It was just a warning, not an error. The SWF should have run regardless, but yes, it's smart to rename it to avoid confusion.

toFlash
08-08-2007, 08:48 AM
I've a problem too:

I have a class with following code:
private function onClick(evt:MouseEvent) {
root.mc_list.gotoAndPlay(2);
}
in StrictMode Flash CS3 compiler issues the following error:
1119: Access of possibly undefined property mc_list through a reference with static type flash.display:DisplayObject.
in timeline in root I puts movieclip with name "mc_list"
please help me find the error in my code?
Thanks

dr_zeus
08-08-2007, 05:19 PM
The compiler doesn't know that mc_list is a MovieClip on the root. Try this:

(root as MovieClip).mc_list.gotoAndPlay(2);

toFlash
08-09-2007, 11:21 AM
The compiler doesn't know that mc_list is a MovieClip on the root. Try this:

It's work!!! :) Thanks!

skyygirl
08-14-2007, 07:10 PM
I am not a flash programmer at all - but I found a bit of code that I want to embed on a site that I have a need to lock down.

Action Script:
this.onEnterFrame = function(){
System.setClipboard("As long as this page is open your copy/paste functionality has been disabled.");
}

Error:
Warning: 1090: Migration issue: The onEnterFrame is not triggered automatically by Flash Player at run time in ActionScript 3.0. You must first register this handler for the event using addEventListener ( 'enterFrame', callback_handler).

What do I need to do and where?

TIA!

joffley
01-29-2010, 11:10 AM
(root as MovieClip) just saved me a huge amount of time, cheers!!