A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [AS3] TextField htmlText <img> src as Class

  1. #1
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312

    [AS3] TextField htmlText <img> src as Class

    Hey flashkit,

    I'm having a rough time finding an answer to this. (I've searched and searched...)

    I am trying to build a form in a flash project.
    I want to use one (1) textfield and embed the form controls in it using the <img> tag.

    This works fine with library items (as the docs suggest and from long ago apps I've worked on), but I don't have a .fla for this project.

    Instead, I want it to embed an instance of a class in there.

    ex.

    PHP Code:
    var txt:TextField = new TextField ();
    txt.htmlText "age: <img src='com.bit101.components.NumericStepper'/>"
    Can this be done? If not, is there a workaround?
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  2. #2
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312

    Thumbs down

    Well, here is what I have found...


    You CAN make a .fla with a library item exported for actionscript, and use that in the htmlText of the swf generated from that fla.
    You CAN make that library item an interactive movieclip. (ie, clicks, animations etc...)

    You CANNOT create a .swc from a .fla and use that swc library item in a htmlText.
    You CANNOT just use an arbitrary class as the src



    PHP Code:

    //(Symbol1 is a movieclip library item with just a rectangle drawn in it)
    import flash.text.TextField;

    var 
    txt:TextField = new TextField();
    txt.width txt.height 150;
    txt.border true;
    txt.htmlText =  "age: <img src='Symbol1' height='10' width='10' align='right'><br>";
    txt.htmlText += "name: <img src='Symbol1' height='10' width='10' align='right'><br>";
    addChild(txt); 
    this simple example looks terrible and I see nothing wrong with it

    The text all appears on one line, and it looks as if only one Symbol1 is drawn in.

    This is a terrible realization, and it makes me quite sad that I cannot find a solution to my problem.
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


Tags for this Thread

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