Compile error 1061 displays when attempting to play timeline animation

In summary, the conversation is about an error that occurs when trying to play a timeline animation by clicking on a button in Flash AS 3.0 and CS5. The error is "1061: Call to a possibly undefined method play through a reference with static type Function." To fix this error, the code needs to be added to define and play the animation through a function.
  • #1
fredlexus
3
0
Hi,

Scenario: Click on button and timeline animation plays (the animation is a panel that rotates from the back to the front)

Flash AS - 3.0
CS5

Error:
Scene 1, Layer 'actions', Frame 1, Line 11
1061: Call to a possibly undefined method play through a reference with static type Function.

What does this error mean and what code needs to be added to fix it?

Any help will be appreciated.


Code:
[FONT="Verdana"][SIZE="1"]
import flash.events.MouseEvent;

bullet_btn.addEventListener(MouseEvent.CLICK, bullet);
function bullet(event:MouseEvent) :void
{
	spinbul_pt_1.play();
}

function spinbul_pt_1(){
	bul_pt_1_MC.play();
}[/SIZE][/FONT]
 
Technology news on Phys.org

1. What is compile error 1061?

Compile error 1061 is an error message that appears when there is an issue with the code that is attempting to play a timeline animation. It indicates that there is an undefined method or property being called in the code.

2. Why does compile error 1061 occur?

Compile error 1061 occurs when the code is trying to call a method or property that does not exist. This can happen if there is a typo in the code, or if the method or property has been removed or renamed.

3. How can I fix compile error 1061?

To fix compile error 1061, you will need to review your code and find the line where the error is occurring. Make sure that the method or property being called actually exists and is spelled correctly. If it does not exist, you may need to create it or find an alternative solution. Once the code is corrected, the error should be resolved.

4. Can compile error 1061 be prevented?

Yes, compile error 1061 can be prevented by carefully reviewing and testing your code before attempting to play the timeline animation. Make sure that all methods and properties being called actually exist and are spelled correctly. Additionally, regularly updating and maintaining your code can help prevent this error from occurring.

5. Are there any other common causes of compile error 1061?

Aside from calling undefined methods or properties, compile error 1061 can also occur if the code is attempting to call a method or property that is out of scope. This means that the code is trying to access something that is not accessible from its current location. It can also occur if there are issues with the program or software being used to play the timeline animation.

Similar threads

  • Programming and Computer Science
Replies
1
Views
3K
Back
Top