TLFTextField and AS3 / CS5

Background:
I could not make a purely AS3 TextFlow object display text in the same way as a TLFTextField object in the library, even though the settings appeared to be the same (checked using the library xml file in the fla/zip). (The spacing between letters was not kerned in the same way.)
Therefore I changed tack and attempted to use a library object and update it with AS3. However, I feel that the TLF documentation is somewhat lacking, so I am sharing my findings, simple though they may seem to pros. The text was used for buttons, so I only needed to consider one paragraph with only one span.
What I worked out
It has taken me a long time, but I have finally worked out how to access the elements in a TLFTextField object in the library.
//create an instance of the 'tlfContainer' symbol containing the  TLFTextField object, with the Instance name 'tlfTextField' and 'default'  as the text.
var container:tlfContainer = new tlfContainer;
//target the textFlow of the object
var flow:TextFlow = container.tlfTextField.textFlow;
//get the first (and only) child of the TextFlow, which is a ParagraphElement
var paragraphElement:ParagraphElement = flow.getChildAt(0) as ParagraphElement;
//get the first (and only) child of the ParagraphElement, which is a SpanElement
var span:SpanElement = paragraphElement.getChildAt(0) as SpanElement;
Now I can change the text (eg span.text = "new text";) and format the text (eg paragraphElement.direction = "rtl") AND have it display correctly!
Questions:
1. Is something like this documented somewhere that I have missed?
2. Is there an easier way to do this, ie directly access elements? Using getParagraph() gave a null, even though the above worked..
3. Why should a dynamically generated TextFlow look different to a TLFTextField object?

It took me a while to find it when I saw an example of code a couple of days ago.
It basically means a variable number of comma delimited paramaters. From online doc's:
Statements, Keywords & Directives 
Definition keywords
... (rest) parameter
Specifies that a function will accept any number of comma-delimited arguments.
I am trying to find a coding example or two to model my own.
Thanks,
Jim

Similar Messages

  • Image not loading in TLFTextField and TextFlow (Using Flash CS5)

    Hi,
    I am using TLFTextField and TextFlow both in my application. Its a chatting application in which I need to show smileys. For this I use these components.
    I have uploaded my code on: http://dl.dropbox.com/u/43019589/25-9-2011.rar
    Problem:
    1. When I load image at runtime the image does not shows in components.
    2. When I import these images in Flash and convert it into movieclips the it loads in the textfield where user type the text, but it does not show up in the chat text area.
    Show text in user text chatarea:
    The code is written on Layer "Frame Actions" Frame 41 Function "showUserMessage". In this function it is showing the typed text in the user chat area.
    User typing text:
    The code is written on Layer "Generic Actions" Frame 11 Function "sendChatText". In this function it is picking text from user type text field.
    The textfields are located on Layer "TLFTextFields".
    The smileys that I am using are gif images(animated). I try loading images into flash and by calling from relative/absolute URL.
    Please help me solving this problem. My project deadline is coming close .
    Regards,
    Amandeep Singh
    PS: Please ignore testfield that is placed outside the stage.

    Hi Jin, Thanks for your response .
    Here is the result of tempSplit.join("") in function sendChatText():
    <img color="#000000" fontFamily="Arial" fontLookup="inherit" fontSize="11" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="129.090909%" textAlpha="1" textRotation="auto" trackingRight="0%" height="18" width="39" source="[class twothumbsup]"/><span color="#000000" fontFamily="Arial" fontLookup="inherit" fontSize="11" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="129.090909%" textAlpha="1" textRotation="auto" trackingRight="0%"></span>
    sendChatText() function removes the TextFlow and p tags from the tlfMarkup output.
    I converted the animated smiley to movieclips, here in the above response you can see the source of img tag is a movieclip class.
    Thanks for your response. Please help me find what I am doing wrong.

  • Can only draw circle and square in Illustrator CS5 and Photoshop CS5

    I am experiencing a strange bug that seems to be affecting both Photoshop CS5 and Illustrator CS5. In Illustrator, when I try to draw a rectangle or ellipse I can only draw circles and squares. Also I can't change the color of selected objects. When I try to change its fill nothing happens. I can also only drag objects on the 0, 45 and 90 degree angles. Also I can no longer select off an object by clicking on the artboard. When I click on the artboard nothing happens.
    Similarly in Photoshop I can only draw straight lines using the brush tool. The  marquee tool is also not functioning properly. When I try to use the marquee tool the marching ants form a square but when I release the mouse it selects a rectangular portion. Strangely if I use the marquee tool and make selection I can press the shift key and add to it but this second selection's marching ants are not square but are properly rectangular.
    Since the problem seems to be affecting both Illustrator and Photoshop I'm thinking it's probably some kind of system conflict or perhaps an application running in the background is affecting it. Also if I restart my mac the problem goes away. Unfortunately the problem eventually returns.
    Anyway I'm pretty sure most of the suggested fixes involve systematically going through all the programs running in the background and trying to determine which if any might be affecting Illustrator and Photoshop but I just thought I'd post something in case someone else had the problem or knew of any fixes.
    I'm running CS5 on a MBP.
    Thanks!

    Ok I figured out the problem. It was another application called teleport which lets you control 2 macs with one mouse. It requires a hot key and in my case that was the shift key. Even though it was running it was still affecting me. Had to quit it and restart. If you're having a similar problem I'd check to see you're not running any other applications that can be activated with a hot key.

  • How can I get photoshop and Illustrator CS5? I cannot see it anywhere. My computer(PC) can only use CS5

    How can I get photoshop and Illustrator CS5? I cannot see it anywhere. My computer(PC) can only use CS5

    If you do not own a license for CS5 there is not much you can do to get it thru Adobe.  They only sell current versions of their software (CS6 or Creative Cloud).  You would need to find a third party vendor and take your chances with them.
    If you do own a CS5 license you can download the software thru the following page and use your serial number to activate:
    CS5 - http://helpx.adobe.com/creative-suite/kb/cs5-product-downloads.html

  • I can't get any contact info for installation problem- I just bought a Mac Air and my CS5 is asking for a reinstall. Mac Air has no DVD slots. HELP I al VERY FRUSTRATED THAT ADOBE HAS NO WAY TO GET HELP

    I can't get any contact info for installation problem- I just bought a Mac Air and my CS5 is asking for a reinstall. Mac Air has no DVD slots. HELP I al VERY FRUSTRATED THAT ADOBE HAS NO WAY TO GET HELP

    You are right, Adobe does not support CS5 because it is no longer sold.
    Simply download the trial version of CS5 from this Adobe web site and input your serial number.
    Adobe - Photoshop : For Macintosh

  • We have CS5 installed on a workstation, we have the products registered with Adobe.  We are going to be replacing this workstation and reinstalling CS5 on the new workstation.  Do I need to unregister the product in order to be able to reinstall it on a n

    We have CS5 installed on a workstation, we have the products registered with Adobe.  We are going to be replacing this workstation and reinstalling CS5 on a new workstation.  Do I need to unregister the product to be able to install it on the new workstation.  If so, how do I do this?
    Thanks

    you should deactivate (help>deactivate) that installation on the old workstation.  then download and install on your new work station using your serial number.  (ie, make sure you can find your serial number - if you need help with this, let us know.)
    Downloads available:
    Suites and Programs:  CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5 | 4 | 3
    Captivate:  7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Output sharpening in Adobe Camera Raw (ACR) and Photoshop CS5

    Output sharpening in Adobe Camera Raw (ACR) and Photoshop CS5
    I want to do two-pass sharpening - capture and output - with output capture done just before I print. I do the initial (capture) sharpening in the ACR Detail/Sharpening panel, with Amount slider set to, for example, 100.  Then, I open the image to PS CS5 as a Smart Object, and use layers and masks for further editting.
    My question is, can I go back to ACR for the final (output) sharpening pass?  When I re-open the file in ACR, the Sharpening Amount slider is back to zero, but the other three sliders are still at the settings I used at the start of the process, i.e., the capture sharpening.  If I again set the Amount slider to a positive value, then again open the image in PS for printing, will my second pass through the ACR Sharpening panel take effect - will it accumulate on top of the initial sharpening?
    By the way, the reason I want do output sharpening in ACR rather than, say, PS Unsharp Mask, is so I can use the Masking slider in ACR, which is much easier than the comparable techniques available in PS.  I am aware that some say you should not do any masking for the output sharpening. I'd like to though.
    Thanks for ideas.

    This is pretty much the way I do it, and I also always found ACR sharpening superior to anything in Photoshop. There is the "sharpen for output" in ACR, but you have little control over it.
    The tricky part is feeding the file through ACR a second time. I don't think re-opening the Smart Object will do anything more than you could have done the first time. I do it with a rendered TIFF, and have an intricate set of actions that I run in the Image Processor Pro. It's a mess, and you don't want to know.
    The frustrating part is how to action ACR. I just can't figure it out. It'll work, and then I have to change some setting and the action stops working. I suspect you need a script, but so far I haven't found any.
    So I've come to a compromise: I first process to TIFF in a temp folder, then I bulk open them in ACR to sharpen, then a second process to finish up.
    For less critical files I have a sharpening action that comes close, involving edge masks and blend ifs, using smart sharpen which tends to preserve edges better than unsharp mask, and with less accumulation of noise.
    Bottom line: I'm also very interested in further comments to this. BTW, I recently bought Lightroom 4, so maybe there is a posibility using that in a mixed workflow.

  • I am steaming - Thru CS3 - CS4 and now CS5 Fireworks is crap

    All through CS3, CS4 and now CS5 Fireworks on 3 different machines Windows XP, Windows Vista and now Windows 7... simply is a crappily written app. And I have been using Fireworks since Macromedia and these problems have only appeared from Adobe.
    Is it to drive folks to Photoshop? After working on it for about 30 min you get 'low on memory' 'internal error'... it is unconscionable that an application that is so expensive can be written so appallingly. And when you run through the forums you just get tons of complaints about the shoddy code at Adobe.
    All of the computers are stacked with 4GB, this one has 16GB on a blazingly fast Phenom Black but that's not the killer... no other app crashes. Not the little $5 dollar apps, not anything. It is so frustrating. Can't someone buy this place and straighten it out!!! Macromedia was known for ridiculously great code and features.
    Had anyone solved this problem... I here if you login in as Donald Duck it might go away. What kind of nonsense is that?
    Help!
    Noel

    xgarth
    don't get so steamy. I am on your side and I actually met Adobe marketing VP in Australia and told him that his CS ****, mmm I mean suite is worthless on a Mac at least. He couldn't care less. They don't fix things they market "upgrades" so idiots like you and me will keep on spending. I for instance use Adobe and Macromedia products since mid 90s' and I must say that nothing has changed for me since FW3 or 4 and Photosop 5.5. Illustrator should always stayed simple but they managed to make it so fat it barely moves. Flash also became something it wasn't intended for and it's days are numbered by HTML5. Adobe Acrobat? you must be kidding. I still don't know what the F this is all about. and so on and so on....
    You will grow out of it eventually like I did. It doesn't worth it. Believe me. Just "upgrade" if you must have some feature. I think DW and Flash are the only products that need to be upgraded because of the industry it's linked to (web). the rest are just tools that still do what they did 10 years ago. they are only "integrated" now.
    There are other tools you can use, not many but there are or simply don't upgrade!!! this is the best way for you and I to tell Adobe what we think.
    Mic

  • I am retired.  In my active years, I purchased Adobe Creative Suite 4 Design Standard and Dreamweaver CS5 for my Windows environment.  I recently spent a fortune to migrate to  Apple.  I realize that my licenses are not recognized by Adobe. I am desperate

    I am retired.  In my active years, I purchased Adobe Creative Suite 4 Design Standard and Dreamweaver CS5 for my Windows environment.  I recently spent a fortune to migrate to  Apple.  I now (and a bite late) realize that my licenses are not recognized by Adobe. I am desperate. I cannot afford the expense of buying or paying access to the software and, still,  I need the tools for all those little things I do for enjoyment. What can be done?

    The licenses are operating system specific, so one option would be to retain use of the Windows machine you had before the Mac.
    If you want to try to use the older stuff on your new Mac you can try installing Windows emulation software such as Bootcamp.

  • Can i install Illustrator CC with Photoshop CS6 and Indesign CS5.5 or can i have some problems of compability? I use Windows 7. Thank u...

    Can i install Illustrator CC with Photoshop CS6 and Indesign CS5.5 or can i have some problems of compability? I use Windows 7. Thank u...

    Generally this should work, but of course there may be occasional compatibility issues across the different programs and their different versions.
    Mylenium

  • As2.0 and As3.0 communicatioin

    Hi,
    i m updating my e-learning course player project with Flash
    cs3 and AS3.0. the old version of course player was in As2.0. which
    load cousre swf files .
    it was working fine Flash8 As2.0.
    the player load course swf. the loaded course swf on a
    specifec frame call a method like this
    _level0.setButton(2) method from course player;
    The setButton(parameter) method defination is in new courser
    player. the loaded movie which is in Actionscritp2.0 not finding
    this method
    in new course player which in Actionscript3.0. its working
    well with the old course player.
    can any one give me solution to solve the issue.
    i can't make changes in course swf files b/c there are
    thousand of course files

    thank for your reply i have used it but it is two way
    communication , as i mentioned in my question
    i can't make changes in my As2.0 course swf files. b/c there
    are thousand of these course files.

  • Hi ERROR U41M1C212 for Update Elements 9 and PS CS5. Any Idea what it is? Thanks for Help.

    hi ERROR U41M1C212 for Update Elements 9 and PS CS5. Any Idea what it is? Thanks for Help.

    If you look at the bottom/right of this screen you have a list of links in 'More information like this'.
    Have a look at them.

  • Tree Component and as3

    Hello ..
    my problem is tree component and AS3 , before we hade such
    easy time with tree component in as2 but now i founded that we cant
    talk directly to tree component and we have to use API and XML ,
    well i never liked XML and before i worked with tree component
    directly and no problem but now , Flex force me to work with XML or
    API(well I don’t know what dose it mean ) and I was tiring to
    find any way to get directly to tree component in Flex2 and no
    result … so my question , do I have use XML ? Is there any
    another way to get to Tree Component ? I was looking in Flex help ,
    and I find the help content is really bad . pleas help , I get
    crazy about this problem …….
    BWY this form work terrible on my PC ….. anyone have
    same problem ?

    Use xml. Resistance is futile.
    Tracy

  • Lightroom 4.3 and Photoshop CS5 Crashing

    For several months, I have been trying to troubleshoot random blue-screen crashes when (and only when) using Lightroom 4.3 and Photoshop CS5 in Windows 7 64-bit.  The Windows stop error code is always 124 (hardware related).  The crash dump files have not provided much help. They just keep referring to "ntoskrnl.exe" and "hal.dll" as possible causes, but that doesn't help isolate specific hardware.  Without going into all the excrutiating details of what I have done to try to find a hardware problem, I am now 99% sure that hardware is NOT causing the crashes.  I recently ran "Who Crashed, Professional Edition 4.01" to analyze the crash dump files.  It identified "cameraraw.dll" and "tliadjust50.dll" (a file installed byTopaz Labs plug-ins Adjust 4, DeNoise 5, and Fusion Express 2) as possible causes of the crashes.  I would like to refresh "cameraraw.dll" to determine if it is in fact causing the problem.  My question is how to replace my existing "cameraraw.dll" file with a new one.  Can I just download a new "cameraraw.dll" file (from where?) and replace my existing "cameraraw.dll"?  Or, do I have to reinstall LR4 and/or CS5 to refresh "cameraraw.dll"?  I really hope I don't have to do that, because I think I would probably have to also reinstall all the third-party plug-ins and extensions I have installed to work with  LR4 and CS5, and that would be a major pain.  Does anyone have any suggestions/

    in each, click help>deactivate.
    then uninstall each.
    then install each on your new computer and activate using your serial number.

  • I had to reinstall Win 7 and PS CS5, and the updates fail even when opened using 'run-as-admin'. Why?

    The title says it all ...
    I had to reinstall Win 7 and PS CS5, and the updates fail even when opened using 'run-as-admin'. Why?

    If you are using Help 》updates, it is outdated. You can however go to Product Updates on the Adobe.com website and download your updates there. I am not at my desk b<t when I get back, I'll get the links unless someone else can do that sooner.

Maybe you are looking for