A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: AS3 Errors: 1120

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    15

    AS3 Errors: 1120

    Hello!

    So yeah, I've been trying to build a kind of 'weapon generator' for part of a project I'm working on but I've hit a wall.

    I've been using a hell of a lot of functions in my little program but for no (apparent) reason, it's generating a lot of errors.

    Specifically:

    Code:
    StockMoveUp.addEventListener(MouseEvent.CLICK, StockUp);
    	StockMoveDown.addEventListener(MouseEvent.CLICK, StockDown);
    	StockMoveLeft.addEventListener(MouseEvent.CLICK, StockLeft);
    	StockMoveRight.addEventListener(MouseEvent.CLICK, StockRight);
    	
    	HandleMoveUp.addEventListener(MouseEvent.CLICK, HandleUp);
    	HandleMoveDown.addEventListener(MouseEvent.CLICK, HandleDown);
    	HandleMoveLeft.addEventListener(MouseEvent.CLICK, HandleLeft);
    	HandleMoveRight.addEventListener(MouseEvent.CLICK, HandleRight);
    	
    	TriggerMoveUp.addEventListener(MouseEvent.CLICK, TriggerUp);
    	TriggerMoveDown.addEventListener(MouseEvent.CLICK, TriggerDown);
    	TriggerMoveLeft.addEventListener(MouseEvent.CLICK, TriggerLeft);
    	TriggerMoveRight.addEventListener(MouseEvent.CLICK, TriggerRight);
    	
    	MagazineMoveUp.addEventListener(MouseEvent.CLICK, MagazineUp);
    	MagazineMoveDown.addEventListener(MouseEvent.CLICK, MagazineDown);
    	MagazineMoveLeft.addEventListener(MouseEvent.CLICK, MagazineLeft);
    	MagazineMoveRight.addEventListener(MouseEvent.CLICK, MagazineRight);
    	
    	CoverMoveUp.addEventListener(MouseEvent.CLICK, CoverUp);
    	CoverMoveDown.addEventListener(MouseEvent.CLICK, CoverDown);
    	CoverMoveLeft.addEventListener(MouseEvent.CLICK, CoverLeft);
    	CoverMoveRight.addEventListener(MouseEvent.CLICK, CoverRight);
    	
    	BarrelMoveUp.addEventListener(MouseEvent.CLICK, BarrelUp);
    	BarrelMoveDown.addEventListener(MouseEvent.CLICK, BarrelDown);
    	BarrelMoveLeft.addEventListener(MouseEvent.CLICK, BarrelLeft);
    	BarrelMoveRight.addEventListener(MouseEvent.CLICK, BarrelRight);
    	
    	GripMoveUp.addEventListener(MouseEvent.CLICK, GripUp);
    	GripMoveDown.addEventListener(MouseEvent.CLICK, GripDown);
    	GripMoveLeft.addEventListener(MouseEvent.CLICK, GripLeft);
    	GripMoveRight.addEventListener(MouseEvent.CLICK, GripRight);
    I can promise you that all of my movieclips share the exact same identifier names with these functions. The top two sections of code here work fine (each line is assigned to a button that modifies the x or y position of the movieclip when clicked). But right after that, Flash tells me that the rest of it is:

    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 834 1120: Access of undefined property TriggerUp.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 835 1120: Access of undefined property TriggerDown.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 836 1120: Access of undefined property TriggerLeft.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 837 1120: Access of undefined property TriggerRight.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 839 1120: Access of undefined property MagazineUp.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 840 1120: Access of undefined property MagazineDown.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 841 1120: Access of undefined property MagazineLeft.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 842 1120: Access of undefined property MagazineRight.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 844 1120: Access of undefined property CoverUp.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 845 1120: Access of undefined property CoverDown.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 846 1120: Access of undefined property CoverLeft.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 847 1120: Access of undefined property CoverRight.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 849 1120: Access of undefined property BarrelUp.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 850 1120: Access of undefined property BarrelDown.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 851 1120: Access of undefined property BarrelLeft.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 852 1120: Access of undefined property BarrelRight.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 854 1120: Access of undefined property GripUp.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 855 1120: Access of undefined property GripDown.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 856 1120: Access of undefined property GripLeft.
    Assault Rifle Generator, Layer 'ACTIONSCRIPT!!', Frame 1, Line 857 1120: Access of undefined property GripRight.

    I've had this problem for a while now and I've looked for a long time on how to solve it. Is there any kind of limit to the amount of button functions I can create? Do I need to tweak any AS3 settings? Does Flash CS5 despise me?

    If there's any help here, it would be greatly appreciated.

    Thanks in advance.

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    1. there is no limit to how many functions you can write.
    2. I would avoid using special characters other than underscores in your layer names. Nothing explicitly forbids it but why ask for trouble?
    AS is telling you cannot find the functions named TriggerUp, TriggerDown etc.
    Are you sure you have those functions defined?
    3. CS5 might just hate you.

  3. #3
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    I agree, Flash is telling you it cannot find the functions.

  4. #4
    Junior Member
    Join Date
    Jun 2011
    Posts
    15
    Thanks for the info guys. I'm going to try re-writing all the functions and instance names to see if it works. Will let you know how much luck I have.

  5. #5
    Junior Member
    Join Date
    Jun 2011
    Posts
    15
    I'm an idiot. It turns out all I had to do was move a single curly brace slightly higher up in my code.

    Works fine now.

    Thanks for the help guys.

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