Undefined method error in custom package even with proper import

I edited the title of this thread to be a little more descriptive about the help I need.
The background: I have a multi-file Flash application that allows users to navigate through multiple pages (similar to a website). I realized yesterday that with each mouse click, I'm loading a page into memory, but not unloading it. After navigating through several pages, my memory really starts to take a hit. So, I want to define a custom package that loads each page and unloads the previous page.
I've gotten as far as defining the pageLoad function, but I keep getting an error that doesn't make sense to me (unless I'm importing the wrong flash packages).
When I test the Flash, I consistently get the following error:
dtutils.as – 1180: Call to a possibly undefined method addChild. – addChild(pageLoader);
Everything I have found indicates that to import the addChild method, I need to import flash.display.Sprite, which I'm doing, but I am still getting the error.
You'll have to forgive me as I'm not extremely familiar with objects or actionscript. I'm more of a hacker, but I grasp things quickly and can build on what I've already learned. This might be obvious to others, but I can't find anything that indicates that I'm doing anything wrong with my code, so any help you can give is greatly appreciated!!
My package code:
package com.clientname.demo
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    public class dtutils
        //Properties
        public var pageLoader:Loader = new Loader();
        public var pagePath:URLRequest;
        //Constructor
        public function loadPage(url:String)
            pagePath = new URLRequest(url);
            pageLoader.load(pagePath);
            addChild(pageLoader);
I've also attempted to replace the four import lines in my package with the following 3 import lines, but I still get the same error message:
import flash.display.*;
import flash.events.*;
import flash.net.*;
The code I'm using to import my package and call the function in my flash file is:
import com.clientname.demo.dtutils;
dtutils.loadPage("../filepath/filename.swf");
I appreciate any help anyone can give me.

Thanks for the feedback. Being fairly new with actionscript (and an object approach, in general), and not being a real developer, I often struggle with naming conventions. Didn't even realize there was a specific convention for what is considered a utility and what isn't. However, I appreciate your feedback and will rename my package so that it isn't confusing to any other real developers that may need to do something with this code in the future.
Thanks!

Similar Messages

  • Using Click Functions Inside ItemRenderers Causing "Undefined Method" error

    I have a tilelist which has an item renderer and the item renderer has a small button in it which intentionally should remove the specific item once the button is clicked making each item removable from the tilelist by clicking the little button on each item within the tilelist. However when I try to apply my removeProduct() function, which I've already defined, to the button I get the error "Call to a possibly undefined method" but this function can be applied to other buttons fine so I know it has been defined correctly. It just seems to throw this error when I try to apply it to the button inside the itemrenderer of my tilelist. Anyone else had this problem? Is it to do with it being within a item renderer?
    Here's my code for the function:-
    public function removeProduct():void { 
    var item:Object = cartTilelist.selectedItem; 
    var idx:int = shoppingCartAC.getItemIndex(item);shoppingCartAC.removeItemAt(idx);

    forst create custom Event:
    public class MyItemEvent extends Event
            public static const MY_ITEM_REMOVE:String = "MyItemEventRemove";
            private var _myItemClicked:Object;
            public function get myItem() : Object{
                return this._myItemClicked;
            public function MyItemEvent(type:String,itemParam:Object, bubbles:Boolean=true, cancelable:Boolean=false)
                super(type, bubbles, cancelable);
                this._myItemClicked = itemParam;
            override public function clone():Event{
                return new MyItemEvent(this.type,this._myItemClicked,this.bubbles,this.cancelable); // bubbling support inside
    inside you Item renderer create util function (you dont have to, but its cleaner) :
    private function removeItem() : void {
                    this.dispatchEvent(new MyItemEvent (MyItemEvent .MY_ITEM_REMOVE,this.data,true,true));
    and then third step (again inside Item renderer)  asign that function as click event handler to button:
    <mx:LinkButton id="removeButton" label="X" fontSize="8"  paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" cornerRadius="6" color="#FF0000" click="removeItem()"  x="1" y="-2"/>
    now wherever you have your  tilelist add listiner to it following way , (or any other way you find it fit )
    yourTileListComponent.addEventListener(MyItemEvent .MY_ITEM_REMOVE,
                         function(e:MyItemEvent):void
                            trace(this + "ItemTo Remove is: " + e.myItem);

  • 1180: Call to a possibly undefined method error for DEFINED method

    Hi,
    I have Document Class  main.Core  that in package main
    In the first frame of the .fla I have:
    stop();
    startGame();
    public function startGame():void {
           world = new World();
            world.startWorld();
    World is class in package world.
    I use import world.World;
    When I am tryng to export I get the error:
    1180: Call to a possibly undefined method startWorld.
    Can someone tell me why?
    Thanks.

    what's the following show:
    package world {
    import flash.display.MovieClip;
         public class World extends MovieClip {
              public function World():void {
    trace(this);         
              public function startWorld():void {
                   trace("b");

  • How to Download the Custom Package Created with all the objects

    Hi All,
    Could any body let me know how to download a custom package created in sap with all the objects including webdynpros and modulepool programs.
    Thanks.

    Hi,
    U can use open source programs available in net like Mass Download, ZAPLINK, SAPLINK.
    Mass Download --> Download the objects
    SAPLINK, ZAPLINK --> Used for downloading and also for importing the downloaded objects to other system.
    Regards,
    Arun

  • LSMW input method error-No Customizing entry defined for period indicator Y in logon language

    Hi,
    I am creating one material through direct input method and its showing error '
    No Customizing entry defined for period indicator Y in logon language'.
    I am passing PERKZ ( periodic indicator ) as blank from file.
    But when i am creating in foreground its automatically taking value 'M' and creating the material.
    And also when i hardcode the value 'M' in LSMW then also its showing same error.
    Can anyone please help urgently?
    BR
    Sumeet

    Check in O02K what is maintained.  As per your error message, External Period Indicator "Y" is missing for that logon language.
    G. Lakshmipathi

  • Error: Create customer specific areas with services

    Hi Experts,
    I am facing problem while creating customer specific areas with services. We have a development for Appraisals and trying to make it work via ESS.
    I have defined resource for area page, defined area, assigned area to an area group page.
    Still the Area is not displaying on Area page.
    Please let me know as to where I have gone wrong.
    Thanks!

    You need to create your workset, and check the URL in PCD of the Iview

  • Strange behaviour: "undefined method" error

    Hello!
    I am trying to build a simple webpage.
    I created a class UserData with some functions, two of them are getUsername and getLastname. I created a HTML form, with the fields username and lastname (written exactly like this), a JSP (signup2.jsp) with the following code:
    <jsp:useBean id="user" class="phil.UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <jsp:forward page="signup3.jsp"/>and another JSP (signup3.jsp) with the following code:
    <jsp:useBean id="user" class="phil.UserData" scope="session"/>
    Lastname:
    <%=user.getLastname()%>Ok. My problem is: when i submit the form, the signup3.jsp raise me a strange error:
    "The method getLastname() is undefined for the type UserData". If I replace <%=user.getLastname()%> with <%=user.getUsername()%> ... well... it works!! It shows me the username I submitted.
    So basically, my script "sees" a function within a class, but it raises an error when trying to call another function in the same class.
    The listing of this "famous" class is:
    package phil;
    public class UserData {
        public String username;
        public String firstname;
        public void setUsername(String value){
             username = value;
        public void setFirstname(String value){
             firstname = value;
        public String getUsername() {
             return username;
        public String getFirstname() {
             return firstname;
    }Anyone has any idea what this error is? I was clear enough? I don't even know how to explain it better....
    I am using Windows XP, Apache with Tomcat 5.5.0, JRE 1.5.0u4 and JDK J2SE 1.5.0u4
    Thanks!

    "The method getLastname() is undefined for the type UserData"
    If I replace <%=user.getLastname()%> with <%=user.getUsername()%> it worksOk, In your class I can see methods
    public String getUsername() {
    public String getFirstname() { I don't see any method
    public String getLastname() { Add that method to your UserData class and try again.

  • Error using custom xpath function with XSL transformations in BPM

    Hi,
    We have created a custom xpath function for use with SOA Suite and BPM. This has been built as per specified within the http://docs.oracle.com/cd/E29597_01/dev.1111/e10224/bp_appx_functs.htm#SOASE11100. We have also reviewed the Oracle Sample for mapper-107-ExtensionFunctions (sample demonstrates the use of user-defined extension functions). This has been registered with jDeveloper and SOA within the oracle.soa.ext_11.1.1 (run ant to include in oracle.soa.ext.jar)
    We ideally want to use this is BPM within an xsl. However when consuming this function is either BPEL or BPM using an xsl, the xsl fails with an error such as:
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/gwCustomXpathUtil_rev1.0/xsl/Transformation_1.xsl<Line 9, Column 113>: XML-22043: (Error) Extension function error: Method not found 'getWeekDayDate'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
    In an Assign it operates fine and returns the expected result. We have included a combination of both of the Config files (ext-mapper-xpath-functions-config.xml and ext-soa-xpath-functions-config.xml) in the META-INF folder, however neither allow the use of this function in the XSL.
    I believe there may be an issue getting the custom xpath functions within XSL files. Hence I have also raised an SR. Has anyone experiences of this?
    Our SOA / BPM suite environment is using 11.1.1.6.4 and has the following patches applied:
    13801175
    14406487 (11.1.1.6.4 SOA Bundle)
    13896993
    13088538
    Regards Dave
    Edited by: DavidGaskell on Mar 14, 2013 10:08 PM

    Hi All,
    I am also facing the same issue...Experts can you please help us.
    hi DavidGaskell, did you find any resolution, if so can you share it with me.....
    Thanks,
    RR

  • "call to a possibly undefined method" error.

    I've been working my way through the tutorials in Gary Rosenzweig's "Flash Game University" book. Working on the "paddle ball" game tutorial, I changed the name of the file from "PaddleBall.fla" to "MyPaddleBall.fla", and changed the name of the .as file and the class definition accordingly. After I do this, I get the above error when calling the initialization function ("startPaddleBall()") The target for the .as file is set correctly. I tried using the original file to test it; it compiles fine as long as it's called "PaddleBall", but as soon as I change the name to "MyPaddleBall" (or anything else), it breaks. I commented out all the other code and replaced it with a trace statement inside the startPaddleBall() function to see if there was something else causing the problem, but I got the same result. When all the other functionality is stripped out, the file still works, but only when called "PaddleBall".
    Any help would be appreciated, thanks.
    -- Mark

    Thanks, in fact I did that. It's also one reason why I commented / stripped out all the other code.
    Here is the code in the .as file as it stands right now in its entirety:
    package {
    import flash.display.*;
    import flash.events.*;
    public class PaddleBall extends MovieClip {
    public function startMyPaddleBall() {
    trace("Started");
    This code, combined with the file PaddleBall.fla (containing the function call "startMyPaddleBall()") works. When I change it to "public class MyPaddleBall" and also change the names of the .fla and .as files to MyPaddleBall, it breaks.

  • Question about undefined method error

    method in CalculatorMethods.java
    public static Date setStartDate(int leaveYr,String feb,String apr,String may)throws java.text.ParseException
    return startDate;
    }     advancedOptions.jsp
    startDate = CalculatorMethods.setStartDate(leaveYr,startMonthFeb,startMonthApr,startMonthMay);now i get this error
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 38 in the jsp file: /al/jsp/advancedOptions.jsp
    Generated servlet error:
    The method setStartDate(int, String, String, String) is undefined for the type CalculatorMethods
    An error occurred at line: 38 in the jsp file: /al/jsp/advancedOptions.jsp
    Generated servlet error:
    The method setEndDate(int, String, String, String) is undefined for the type CalculatorMethods
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    ok, im an idiot, but i suspected that anyway,
    eclispe wasent highlighting the Message class name, which i hadnt imported, therefore the method was not being reconised!
    Sorry :)
    Edited by: Sir_Dori on Nov 4, 2009 1:55 PM

  • Cannot resolve symbol error even with class imported

    Hi
    I'm trying to print out a java.version system property but keep getting a
    cannot resolve symbol error
    symbol: class getProperty
    location: class java.lang.System
    I've looked at the API and getProperty() is a method of lang.System
    Can anyone throw any light?
    thanks
    import java.lang.System;
    class PropertiesTest {
        public static void main(String[] args) {
                String v = new System.getProperty("java.version");
                 System.out.println(v);
    }

    Thanks Jos
    It compiles but I now get a runtime error
    Exception in thread "main"
    java.lang.NoClassDefFoundError:PropertiesTest
    What do you reckon is the problem?
    thanks
    java -cp .;<any other directories or jars>
    YourClassNameYou get a NoClassDefFoundError message because the
    JVM (Java Virtual Machine) can't find your class. The
    way to remedy this is to ensure that your class is
    included in the classpath. The example assumes that
    you are in the same directory as the class you're
    trying to run.I know it's a bad habit but I've put this file (PropertiesTest.java) and the compiled class (PropertiesTest.class) both in my bin folder which contains the javac compiler

  • Popular weblogic VersioningError occuring with Orion even with proper manifest file.

    Hi All,
    I am using orion as a servlet engine, accessing the ejbs on weblogic.I have the correct
    information in weblogic.jar/meta-inf/manifest.mf file, viz,
    Implementation-Vendor: BEA Systems
    Implementation-Title: WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
    Implementation-Version: 6.1.2.0
    Class-Path: xmlx.jar
    But I still get the following error when trying to get the initial context from weblogic.
    weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH
    at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:38)
    at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:76)
    at weblogic.kernel.Kernel.initialize(Kernel.java:103)
    at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:82)
    at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java
    :161)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:119)
    The problem occurs when I put weblogic.jar in orion\lib folder but the problem stops
    when I update the classpath entry in META-INF\Manifest.mf file of orion\orion.jar.
    I dont want to put weblic.jar entry in META-INF\Manifest.mf file of orion\orion.jar
    because I am using weblogic JMS and all my classes that are accessed by JMS, also
    needs to be put in META-INF\Manifest.mf file of orion\orion.jar.
    So I shall have to update the manifest file of orion.jar again and again,that I want
    to avoid.
    Your help shall be highly appreciated......
    Thanks !!
    Rais

    Justin,
    "Justen" <[email protected]> wrote in message
    news:3ecb8a88$[email protected]..
    Did you ever find a better solution?You highly reduce chances of getting an answer
    when you don't quote original message.
    Regards,
    Slava Imeshev

  • HT201401 Hi, My iphone 4s started to show randomn shut downs and would turn on only when connected to charger even with proper charge..after 2 days of randomn power off the phone went off and stuck at red battery indicator for charging..it wont turn on.tr

    Tried to reset but no use..not responding..i had a spare iphone 3gs ..which i started to use in mean time now its showing same symptons ..Anybody can help and throw some light..my phones have  expired warranty

    Gdgmacguy : my friend , i tried all basics soft reset, hard reset on my iphone 4s..the phone is not booting at all its stuck red battery screen..even itunes is not recognising the device...
    My other concern is, i started to use my spare iphone 3gs after my 4s gt dead..but 3gs is also showing same symptoms..randomn switch off and will boot only once conected to charger with plenty of charge..i tried to restore, reset on this device..im afraid it might crash as welll...so need a solution..

  • Upload my .APK file onto Google play error, after i build it with dreamweaver cs6

    http://tv.adobe.com/watch/cs6-creative-cloud-feature-tour-for-web/using-the-phonegap-build -panel-in-dreamweaver-cs6-to-build-native-applications-for-android-and-ios-devices/
    after i done on the video clip above.....
    then go to my google developer site to upload the .APK (which is app.apk) file but google says the following :
    UPLOAD FAILED
    You need to use a different package name because "com.example" is restricted
    You upload an APK that was signed in debug mode. You need to sign your APK in release mode.
    please help ..

    I write about my new tests,  I've found this good Google documentation URL : http://developer.android.com/tools/publishing/app-signing.html ;-).
    I don't know if this method is more valid or even with my first method, but I downloaded the tools and I followed the method to create a keystore, with no success :
    I've created a keystore/ pair of keys, it's Ok :
      keytool -genkey -v -keystore certificatAutoSigne-2013.keystore -alias certificatAutoSigne-2013 -keyalg RSA -keysize 2048 -validity 10000
    But I don't understand where can I add the Google public key to sign my APK file, because the keystore isn't a text file !
    Secondly I've error message with this command line :
      jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore certificatAutoSigne-2013.keystore MyAPKFile
    Obviously an APK file already signed can't be re-signed. I don't know how to creat APK file no signed with ADT, do you know ?

  • Unable to save a Z-Tcode in Custom Package,unable to assign a transport Req

    Hi all,
    I am trying to create a T-code for standard SAP Program RSTXPDFT4. I was able to successfully create a T-code for this report program which has selection screen.
    But I created it as a Local Object.
    Now I am trying to create another T-code for the same SAP standard program in our custom package used in our company called /ABCDE/FGH01.
    But it does not allow me to save the T-code in this custom package and throws an error saying
    u201CCustomer Object Z_TCODE cannot be assigned to package /ABCDE/FGH01 u201D.
    Why am I unable to save it in a custom package and assign a transport request for it, Is it because I am creating t-code for standard SAP program? If I try to save it as local object I donu2019t get any error and it works perfect. But my actual requirement is to make the object transportable and save in custom package.
    Some one please help me with this.

    /ABCDE/FGH01 <<< "not a custom package.. custom packages start with Z
    /ABCDE/ is a registered namespace, and could very well be customer code. It is not all Y and Z any more.
    One thing we noticed when we used a registered namespace was that if your package was in the registered namespace, then your object also had to be. That is, if your tcode starts with Z, your package name must also start with Z. if your package name starts with /ABCDE, the so too must your TCODE. I dont know this to be 100% fact, becuase we no longer use a registered namepsace, i just seem to recall that it was true.
    be wary of creating tcodes that start with /, too... the users will always have to put /n or /o in front of them. In general, we really hated using the registered namepsace, and quickly renamed a TON of stuff to get away from it.

Maybe you are looking for