dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: addFrameScript error but it's not in the code

  1. #1
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930

    addFrameScript error but it's not in the code

    Just trying to break out a function that was working fine within flash to it's own class and I keep getting an error on code that's not there!!

    Code:
    package 
    {		
    	// Imports
    	import flash.net.*;	
    
    	public class vdm
    	{		
    		public var gw:NetConnection = new NetConnection();
    		public var res:Responder = new Responder(onResult,onFault);
    		public var d:Array = responds.serverInfo.initialData;
    		public var responds:Object;
    		
    		public function onResult(responds:Object)
    		{
    			trace("success "+responds);
    		}
    
    		function onFault(responds:Object):void
    		{
    			for (var i in responds)
    			{
    				trace("fault "+responds[i]);
    			}
    		}		
    				
    		
    	} // End Class
    	
    } // End package
    and in the fla I have:
    Code:
    gw.connect("gatewayPath");
    gw.call("GrabData.GetData", res);
    Works fine if I put the vars and function in flash and publish it:

    Code:
    import flash.net.*;
    //text_txt.htmlText=" ";
    var gw:NetConnection = new NetConnection();
    gw.connect("gatewayPath");
    
    var res:Responder = new Responder(onResult,onFault);
    
    function onResult(responds:Object):void
    {
    	trace("success "+responds);
    	var d:Array = responds.serverInfo.initialData;	
    }
    
    function onFault(responds:Object):void
    {
    	for (var i in responds)
    	{
    		trace("fault "+responds[i]);
    	}
    }
    
    gw.call("GrabData.GetData", res);
    but, when I make it an .as file and compile it, I get:
    1180: Call to a possibly undefined method addFrameScript
    addFrameScript(0,frame1);

    ??
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    addFrameScript is one of those functions that is called behind the scenes by code generated by the flash compiler. It is called to place any code (or comments or anything) you've got in frame script into the instance of your movieclip at runtime.

    addFrameScript is a method on MovieClip, so if you're getting 'undefined method' for it, then something's trying to call addFrameScript on something that isn't typed as MovieClip.

    What is your document class? it needs to be or extend MovieClip. Also, how are you creating and calling your vdm instance?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center