View Full Version : 1180: possibly undefined method
mrwizzer
April 14th, 2009, 05:19 PM
I'm trying to use the AS3 version of Adobe's new Flash Media Server 3.5 bandwidth detection, using their documentation, (flashmediaserver_dev_guide).
The BW detection works fine (runs a bandwidth check and displays the bandwidth in a trace statement), but that only seems to work if the flash file that accompanies the .as file is left completely blank/empty. As soon as I try to put in even the simplest actionscript, (stop() for example), I get an error message that says "1180: Call to a possibly undefined method addFrameScript." and a similar one for the stop() method.
Do I need to, in the .as class file, extend a class other than the Sprite class that's listed in the documentation?
Any light you can shed would be appreciated.
senocular
April 14th, 2009, 06:29 PM
Those are MovieClip methods that it looks like you're trying to use on a Sprite. Make sure your class instance is a MovieClip or extends MovieClip
Krilnon
April 14th, 2009, 07:01 PM
Make sure your class instance is a MovieClip or extends MovieClip
There is a lame joke (or something) that could be made here involving is and how you could have left off the last 3 words of your sentence.
And yes, I realize that you were just being clear, etc. etc., but I was oddly compelled to make this post.
adBuryD
May 21st, 2010, 05:18 AM
hello guys,
I am posting in this *post* as i have a similar problem but not related to cs4 or 5 but cs3.
I had read that sprites are movieclips with timelines so unless you need to go beyond frame one you are safe using sprites
also senocular said movieclip methods here, but i dont get which are the ones that a sprite wont accept cos sprite takes enterframe events too
var container:Sprite = new Sprite();
addChild( container );
container.addEventListener(Event.ENTER_FRAME, scaleTheMc);
The above code i had used before and it work fine..
Thought my current issue is not that . I have the below code in randomGen.as
package {
import flash.display.Sprite;
public class randomGen extends Sprite{
public function randomGen():void {
trace("hello")
}
}
}
using this as the *document class* gives me a the
"1180: Call to a possibly undefined method addFrameScript." error but importing it like
import randomGen;
var gen:randomGen = new randomGen()
works fine.I am not very good at OOP and I find it hard to understand a lot of the concepts involved but still i needed to ask that does making it the document class causes it to have timeline added to it or something ?
Krilnon
May 21st, 2010, 10:47 AM
No, you can have some class that extends Sprite that isn't a MovieClip that's the document class. You'll run into trouble if you have stuff on frames in your timeline, because Flash will attempt to do stuff like addFrameScript for the frames that have scripts on them. The Sprite class doesn't have that method, so you should remove all of the scripts from all of the frames in your movie, including the first frame. You can put those scripts inside the declaration of the document class itself, perhaps in the constructor.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.