dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: major bug? createTextField

Hybrid View

  1. #1
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749

    major bug? createTextField

    OK, so I made a work around to Flash not being able to pass object variables between loaded SWF, but now I find createTextField is screwing up.

    This is the situation, I am dynamically building a menu. The menu file works under the following situations:
    1. On its own in any situation.
    2. When loaded into another movie in IE.

    But, when loaded into another movie in Flash, or in the projector, the createTextField() method fails and I have blank menus with no labels.

    I have done traces on all the targetpath()s and tried multiple methods of referencing the MC. The createTextField line is the only line that doesn't work.

    Is there a maximum number of MC you can nest?

    Is there a bug in createTextField?

    Is there a bug in the player?

  2. #2
    madskool.wordpress.com brutfood's Avatar
    Join Date
    Apr 2002
    Posts
    469
    Ok, I created two .swfs. each containing a single frame with some actionscript.

    the first contained:

    loadMovie("txttest.swf",place); //place is an empty movie clip
    stop()

    the second contained:

    createTexField("mytext",1,100,10,300,100);
    mytext.text="Hello world";
    stop()

    I tested the movie from within flash and it worked. Is this not the problem?

    This doesn't mean that there isn't a bug in MX - I've found several, and they are flakey, and sometimes things only go wrong on some people's machines. The shared library bug I found manifested itself locally on my computer, but not when the browser accessed the same files online (which made testing difficult) Flash MX really changed my opinions about Flash and about Macromedia.

    I've managed to nest many many movie clips. Check out the Flash WEB player on my web site link. (Although this version is very out of date)
    AIR, ActionScript 3, Flex and Flash expert and freelance developer

  3. #3
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    I am under a major deadline with the aforementioned bug leaving me way behind (building a workaround) but I will try to get a sample up in a few days time.

    I am using RegisterClass to build a series of windows menus from XML. The label display is the only issue, and only when loaded into another SWF.

    Because I am building all the menus dynamically, I have to apply functions to the field immediately and there is no time to wait to allow Flash to catch up. If I do a trace:

    // This checks I have actually referenced the MC correctly
    trace(targetpath(pathref));
    pathref.createTextField("label",1,100,10,300,100);
    // If the createTextField was successful, this will
    // show the path to the label
    trace(targetpath(pathref.label));
    // This is a method of my registered class that
    // formats the menu label ...
    this.format_menu_label(pathref.label, menu_item_data);


    When loaded into another SWF
    The first trace gives me the correct path but the second trace is undefined as the text field is not present and so the function fails.

    When run on its own
    The first trace gives me the correct path, so does the second and the function succeeds.

  4. #4
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749

    FOUND IT! (I think)

    It seems quite consistent, I have a housekeeping function for directories and file locations. When I include the http:// domain, all sorts of oddities occur. When I omit it, it works perfectly.

    I am guessing this has something to do with Flash security and should therefore be seen as a good thing.

    I don't care, at least I have a cause and effect now, so I can avoid it.

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