A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Doesn't work when export, why?

  1. #1
    Member
    Join Date
    Nov 2007
    Location
    Brazil
    Posts
    47

    resolved [RESOLVED] Doesn't work when export, why?

    I'm making a simple move object using "...rest", when I test my movie in 3DFA window this woks well, but when I export doesn't work.!

    My code and a simple sample .movie in attach
    Code:
    When movie starts:
    ob1 = element ("Paint 2");
    ob2 = element ("Paint 3");
    ob3 = element ("Paint 4");
    
    On every frame:
    function alignTL(o:String, ...outros):void
    {
    o.x += (0 - o.x) / 5;
    
    for (var ob in outros) {
    outros[ob].x += (0 - outros[ob].x) / 5;
    }
    }
    
    alignTL(ob1, ob2, ob3);
    Attached Files Attached Files
    []'s
    leocavalcante.com

  2. #2
    Member
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    76
    The problem is that you declare the parameter o as a String. The String class has no x-property, so an error occures.

    Try to change the declaration to:
    Code:
    function alignTL(o:*, ...outros):void
    ...and put the function into the starting script.

    Cheers,
    Leifi

  3. #3
    Member
    Join Date
    Nov 2007
    Location
    Brazil
    Posts
    47
    Thank you so much
    []'s
    leocavalcante.com

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