A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: error 1120 --

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    29

    error 1120 --

    1120: Access of undefined property your_movieclip. that is what i am getting...


    under the AS code:


    public function onSubClick(e:MouseEvent):void {
    your_movieclip.gotoAndPlay(Number(e.currentTarget. linkURL));


    on my main fla:

    i have an empty movie clip with the instance of : your_movieclip

    and this code on frame 5:


    Code:
    var imageRequest:URLRequest = new URLRequest("p2.swf");
    var imageLoader:Loader = new Loader();
    imageLoader.load(imageRequest);
    addChild(imageLoader);

    and the xml :


    Code:
    <menuItem name="About Us" linkURL="2" target="" subMenu="1">
    
       <subMenuItem name="Our Team" linkURL="5" target="" />
    Any ideas what i am doing wrong?


    thanks in advance for your time.

  2. #2
    Senior Member
    Join Date
    Jul 2006
    Location
    San Jose, CA
    Posts
    334
    There's a space between the . and link, not sure if that just for what you did on the forum.

    Code:
    ...get. linkURL));
           
          /\
    How are you accessing the xml, and what is the subclick function attached to?
    I (Love | Hate) Flash.
    ----
    Save a version back so others may help you!

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    29
    hi, thanks for replying... i m new to flash as3, so bare with me..

    here is the code i have to access the menu in my main fla:

    Code:
    import classes.*;
    
    var menu:MovieClip = new MenuHoriz();
    menu.x = 0;
    menu.y = 3;
    addChild(menu);
    not sure about your other question..

    how can i upload the files so you understand it better?

  4. #4
    Junior Member
    Join Date
    Dec 2009
    Posts
    29
    this is the submenu as file.....
    but the code i was changing was under the horizontal menu .as


    Code:
    package classes {
    	
    	// Required import statements
    	import flash.display.MovieClip;
    	import flash.filters.DropShadowFilter;
    	import flash.text.*;
    					
    	// Defines the Sub Menu Item class as an extension of the MovieClip class
    	public class SubMenuItem extends MovieClip {
    	
    		var linkURL:String;
    		var linkTarget:String;
    					
    		// SUB MENU ITEM CONSTRUCTOR
    		public function SubMenuItem(itemColor, shadowColor, itemname, itemLinkURL, itemLinkTarget) {
    			linkURL = itemLinkURL;
    			linkTarget = itemLinkTarget;
    			
    			// Establish text formatting and settings
    			var submenufont:Font = new MenuFont();
    			var subitemTxtFmt:TextFormat = new TextFormat();
    			subitemTxtFmt.font = submenufont.fontName;
    			subitemTxtFmt.color = itemColor;
    			subitemTxtFmt.size = 10;
    			
    			var subitemTxtFld:TextField = new TextField();
    			subitemTxtFld.defaultTextFormat = subitemTxtFmt;
    			subitemTxtFld.selectable = false;
    			subitemTxtFld.multiline = false;
    			subitemTxtFld.text = itemname;
    			subitemTxtFld.autoSize = TextFieldAutoSize.LEFT;
    			
    			subitemTxtFld.embedFonts = true;
    			subitemTxtFld.antiAliasType = AntiAliasType.ADVANCED;
    			subitemTxtFld.thickness = 0;
    			subitemTxtFld.sharpness = 0;
    			
    			addChild(subitemTxtFld);
    			
    			// Add a subtle drop shadow to the text
    			var ds:DropShadowFilter = new DropShadowFilter(1, 45, shadowColor, 1, 1, 1, 1, 1);
    			subitemTxtFld.filters = [ds];
    		}
    	}
    }

  5. #5
    Senior Member
    Join Date
    Jul 2006
    Location
    San Jose, CA
    Posts
    334
    Maybe I'm missing something obvious, but in your orginal post you are clearly referencing an XML value. I don't see any XML specific code here.

    My initial question was "What is this function attached to?"
    Code:
    public function onSubClick(e:MouseEvent):void {
            your_movieclip.gotoAndPlay(Number(e.currentTarget.linkURL));
    }
    I (Love | Hate) Flash.
    ----
    Save a version back so others may help you!

  6. #6
    Junior Member
    Join Date
    Dec 2009
    Posts
    29
    sorry.. that function is attached to the class file.

  7. #7
    Junior Member
    Join Date
    Dec 2009
    Posts
    29

    resolved

    GOT IT!!

    this is what i inserted instead....

    MovieClip(root).movies.gotoAndPlay(Number(e.curren tTarget.linkURL));

    and it worked.. well.. sort of.. i got a new error.. 1009...
    ill post that in another tread.. thanks for your time!

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