A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] "Access of undefined property" from SWF element

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Location
    Sao Paulo, SP - Brazil
    Posts
    7

    resolved [RESOLVED] "Access of undefined property" from SWF element

    Hi!

    I'm quite new in Actionscript (about 2 months), knowing the basics. But I have this problem that I cannot find anywhere!

    I got this old code, that works, that a guy made here at work, but he's not here anymore. When I tried to compile, it gave many compile errors like

    Code:
    Error: access of undefined property foo
        foo.core.searchButton.enabled = false;
        ^
    for instance (changed the original for the sake of post size, it's so many errors like that with different foo's).

    So, I did grep the code and realized that there's no declaration of 'foo' in any of AS classes. None of foo-like vars are declared.

    Then, I got the only movieclip file in src folder opened in Adobe Flash CS5 and there they are: all of those variables that hadn't declaration in code were names of button, text fields, etc in the SWF.

    Given that, I thought it was just some compiler argument I forgot to put, but I didn't find anywhere. I looked for alternatives but I wasn't successfull neither...

    I wish one can help me with this. If nedded, I can put some code here, although I think I could brief enough the problem.

    Thanks in advance!
    Last edited by paulochf; 11-16-2010 at 03:31 PM. Reason: typos

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    How are you compiling?
    If your code is partially in the FLA, then you'll need to use Flash to compile rather than the flex sdk.

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Location
    Sao Paulo, SP - Brazil
    Posts
    7
    Quote Originally Posted by 5TonsOfFlax View Post
    How are you compiling?
    If your code is partially in the FLA, then you'll need to use Flash to compile rather than the flex sdk.
    Hey!

    I'm compiling using mxmlc in Flex SDK.

    So do I need to use Flash CS5? I'll check that!

    But I don't know, do I need to use the .fla or .swf file?


    Thanks!

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You need to compile the fla, which will produce the swf. Since you attempted the sdk first, I assume you come from a coding background and understand concepts like the classpath. Make sure flash's classpath is set to include the root of your package(s) and then publish the fla.

  5. #5
    Junior Member
    Join Date
    Mar 2006
    Location
    Sao Paulo, SP - Brazil
    Posts
    7
    You are right!

    I didn't think using Flash to compile the project. I set the right paths and it compiled fine.

    Thanks for the help! =)

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