A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Why this code is not working?

  1. #1
    Member
    Join Date
    Sep 2014
    Posts
    75

    Why this code is not working?

    Hello All,

    Why this code is not working; it is all about rotating a text field inside an mc container.

    Here is the code;
    var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
    var label:TextField = container.createTextField("label", 1, 0, 0, 150, 20);
    label.text = "Hello World";
    _root["container"]._rotation = 90;

    tried doing sonmething else like; _root["container"].label._rotation = 90;

    and another trial with; label._rotation = 90;

    All not working, the result is that the text disappears from stage.

    Any tips, thanks!

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    embedFonts is your problem, I think.

  3. #3
    Member
    Join Date
    Sep 2014
    Posts
    75
    Hi,

    could you please post the code here, or save the *.fla with an older version.

    thanks!

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Unable to save lower, sorry.
    Perhaps you can upgrade to a higher version or download a trial version, it is CS6.

    You need to use embeFonts combined with textFormat, font needs to be in the library with AS linkage name.

    You should be able to get it from those searches, or last solution, decompile it.

  5. #5

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    The link just takes you to the create clips code !!!
    PHP Code:
    var container:MovieClip this.createEmptyMovieClip("container"this.getNextHighestDepth());

    var 
    textFormat:TextFormat = new TextFormat();
    textFormat.font "libraryFont";
    textFormat.color 0xFF0000;
    textFormat.size 12;

    var 
    label:TextField container.createTextField("label"100020);
    label.autoSize true;
    label.embedFonts true;
    label.text "Hello World";
    label.setTextFormat(textFormat);

    container._rotation 25
    remember the library font

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