Accessing the 'text' in a TextFlow instance?

How do I actually access the textual content of a TextFlow object?
When there is a single SpanElement in the TextFlow then I am able to use ...
mySpan.text
But if I have added multiple SpanElements to the ParagraphElement then how do I get the entire textual content so that I can store it in a String variable.
I am also having problems accessing the entire text when the user has pasted in to an editable field, I presume this is because of multiple SpanElements being created.
Is there anything that is the equivalent to the old ...
myTextField.text
Thanks in advance,
Adrian

Hi Alan,
Thank you so much for your help!!!
Just for the record, here is a working example ...
import flashx.textLayout.container.*;
import flashx.textLayout.elements.*;
import flashx.textLayout.edit.*;
var config:Configuration = new Configuration();
config.manageEnterKey = false;
var textFlow:TextFlow = new TextFlow(config);
var para:ParagraphElement = new ParagraphElement();
var span1:SpanElement = new SpanElement();
span1.text = "Hello ";
span1.fontSize = 12;
var span2:SpanElement = new SpanElement();
span2.text = "World";
span2.fontSize = 16;
para.addChild(span1);
para.addChild(span2);
textFlow.addChild(para);
var cc:ContainerController = new ContainerController(this, 550, 400);
textFlow.flowComposer.addController(cc);
textFlow.flowComposer.updateAllControllers();
trace("textFlow.numChildren:"+textFlow.numChildren);
// OUTPUT: 1
trace("para.numChildren:"+para.numChildren);
// OUTPUT: 2
trace("textFlow.getText():"+textFlow.getText());
// OUTPUT: Hello World

Similar Messages

  • How to access the Text Frame, when we use scrollable frame,

    Hi Friends,
    How to access the Text Frame, when we use scrollable frame,
    Thank you,
    [ Nav ]

    That's the same question:
    how can I access something (a page item) on a page…
    Answer: you need something unique in that object you can get a handle on.
    Or you use the selection a user of your script is doing and work with that selection…
    A "scrollable frame" is nothing special. What it makes it a "scrollable frame" is the DPS software.
    So you have to look for attached labels on the object, that identify the object for the PDS plug-in "Overlay Creator" as a "scrollable frame". That's possible with the "extractLabel("KeyString")" function. But you need to know the appropriate key-string in advance.
    In another of your thread in the DPS forum, I basically answered the question how to obtain those key-strings.
    When knowing the key-string you could loop through all your page items (you can skip all text frames) in the allPageItems-collection, to identify the "scrollable frame" by extracting the right label.
    If you have more than one "scollable frames" you need a second unique identifier for the particular object.
    That could be nearly any property.
    Keep in mind, there is no "scrollableFrames" collection in the DOM !
    Uwe

  • How to access the text symbols of a class

    Hi Experts,
    Can anyone pl. tell me how to access the text symbols of a class.
    Thanks,
    Uday.

    Hi,
    Please check
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm

  • How to access the text definition of sql indexes

    I am able to access the text definition of stored procedures, views, triggers and functions from sys.sql_modules. I want to get the text definition of indexes.
    Can somebody help me in getting the text definition of indexes in sql server.
    Thanks,
    Puneet

    No, Actually I am trying to compare the indexes of two database programmatically.
    I am able to compare the stored procedures, views, triggers and functions by getting text definition directly from 'sys.sql_modules',  on similar lines do we have any way from where I could get the text definition of indexes
    Not sure if there is any table which stores Index defination but there is a table "sys.indexex" which stores index details.
    You may use below query to get index information (It will list out index details but not defination)
    SELECT s.NAME 'Schema'
    ,t.NAME 'Table'
    ,i.NAME 'Index'
    ,c.NAME 'Column'
    FROM sys.tables t
    INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
    INNER JOIN sys.indexes i ON i.object_id = t.object_id
    INNER JOIN sys.index_columns ic ON ic.object_id = t.object_id
    INNER JOIN sys.columns c ON c.object_id = t.object_id
    AND ic.column_id = c.column_id
    WHERE i.index_id > 0
    AND i.type IN (
    1
    ,2
    ) -- clustered & nonclustered only
    AND i.is_primary_key = 0 -- do not include PK indexes
    AND i.is_unique_constraint = 0 -- do not include UQ
    AND i.is_disabled = 0
    AND i.is_hypothetical = 0
    AND ic.key_ordinal > 0
    ORDER BY ic.key_ordinal
    - Also there is one more SP which you can create and then execute it by specifying DB names. It will list out table columns, indexes, constraints difference in one go.
    EXEC SP_Comparedb db1,db2
    Technet Gallary: Compare two databases for objects differences
    Cheers,
    Vaibhav Chaudhari

  • Can two users access the same bootcamp (win os) instance?

    We are two users who are using our imac and we both have own user names in mac os. I created a bootcamp partition with windows xp on it. Can both users access the same partition and create their own user spaces within xp?
    Will that work also if we use Parallel or virtual box? (access the same user data as in boot camp?)
    I would like to have the option for each user to access their windows data either through bootcamp or through the virtual tool.
    Message was edited by: gss2
    Message was edited by: gss2

    gss2 wrote:
    What do you mean Virtual box it will not run on its own partition? I have a virtual box running on my desktop and it runs just fine ...own partition?? I don't understand.
    Running on its own partition means that the installed OS has its own formatted portion (partition) of the hard drive. A virtual machine does not have its own partition. It creates a virtual partition (a file on the computer) that simulates a file system (partition). So Virtual Box, or any other virtualization software, does not run Windows, or any other OS in its own partition.

  • Accessing the text/property file inside the root context

    Hi
              I want to access the property file lying inside the root context folder
              via plain java classes using IO.
              Could you please help me out.

    Hi
    Using this.getClass().getClassLoader().getResource("config_settings");
    In order to load the properties file, uses the classpath search mechnism.
    Basically it means that java will look for your file in the classpath.
    The defualt class path of a web server is usualy the following:
    ContextName/Web-Inf/Classes;ContextName/Web-Inf/lib
    This is why it is working for you when you put your properties file under ContextName/Web-Inf/Classes, but it doesnt work when it is under ContextName/*, as this is not a part of the classpath search.
    You have 3 options:
    1.Put you properties file under the sever defulat classpath
    (ContextName/Web-Inf/Classes;ContextName/Web-Inf/lib,if it's under lib, the file has to be inside a jar file)
    2.Add ContextName/* to your server classpath ( in tomcat->setClasspath.bat file )
    3.Instead of using "this.getClass().getClassLoader().getResource("config_settings"
    read your file directly using the java.io.* library and give it the full path to the file,
    you can store the full path in web.xml file, or using getServletContext().getRealPath("") to locate the context path and read the file from there( but then you are using the Servlet API )
    Hope it helps
    all the best
    tal

  • Accessing raw text of TextFlow and performing a search

    I am trying to figure out the best way to perform a search
    within a TextFlow to locate a specific piece of text (either a word
    or set of words).
    I have had a hard time figuring out how to actually gain
    access to the raw text of the TextFlow that is loaded. Once that is
    loaded, I need to be able to search through that text, find the
    location of the text, and show that container.
    Essentially add search capability to the Pagination example.
    The only thing I can think of that seems like it may work
    would be to export the TextFlow into an XML file, then perform the
    search on the XML file. Once that is done, I would have to figure
    out which position in the xml file the text was located, and load
    the container with that position....
    Surely there is a better way?
    Thanks, Tim

    I think so - here's how I'd reccomend approaching the
    problem.
    Given a TextFlow I'd do a getFirstLeaf. That returns a
    FlowLeafElement. I'd then look at the FlowLeafElement.text property
    to access the text for matching. To advance to the next leaf
    element use FlowLeafElement.getNextLeaf.
    You'll have to do some book keeping when you find a match to
    figure out the absolute position of the beginning of the match.
    Next step would be to use
    textFlow.flowComposer.findControllerIndexAtPosition to figure out
    which container has the matched text.
    Adding niceties you could search a paragraph at a time by
    taking advantage of the limitElement parameter to getNextLeaf.
    After calling getFirstLeaf call getParagraph to find the paragrah
    and use that as the limit element. To advance to the next paragraph
    use null as the limit element and call getParagraph again for the
    new limit element.
    Hope that helps.
    Richard

  • Newbie iPhone: How do I programatically set the text of a UIBarButtonItem?

    Hello,
    This is probably really more of a question on IBOutlets but here goes. I want to have an updateable label on my Toolbar. A label doesn't seem to "stick" on the toolbar so I figured I would drop a UIBarButtonItem on it and then just update the Title property of it to change the text as I needed. Problem is I can't figure out how to get a reference to the UIBarButtonItem in my code.
    With a pure label control, I can drag from the File's Owner to the label in my view to make it an outlet for my ViewController and then access the text property of the label in code. With the UIBarButtonItem, I can't make it an outlet. I know the button is more of an action thing but I don't need to respond to taps, I just want to change the text.
    Thanks for any help,
    Tom

    Tom,
    You should be able to assign the UIBarButtonItem to an outlet as long as:
    1) you have defined an instance variable in FilesOwner of UIBarButtonItem and prefixed it with "IBOutlet".
    2) FilesOwner is set to your custom view controller in the Interface Builder's Inspector panel. If it still thinks it's a standard UIViewController it won't pick up your custom outlets.
    All that being said, I'm not sure you can change the title without using a custom view. The default UIBarButtonItem has an initWithTitle: initializer that may be static (perhaps others know of a way to change it once set). But you can define a custom view for the button. That gives you the ability to add a UILabel and programmatically set the text of the label.
    Cheers,
    George

  • A few tips about using the Text Panel

    A recent question about the text panel set me to working with it and I thought I'd share some tips I discovered, since the help files don't explain the text panel at all.
    At one time I called the text panel "useless", but I've changed my mind -- it's a nice thing to have.  Essentially it's a quick way to instantaneously
    Create a new layer with a semi-transparent layer style.
    Create a rectangular shape on that layer.
    Add a drop shadow effect to that shape.
    All with a double-click!
    You access the text panel from the "Effects" panel and its "Photo Effects" icon, choosing the "Frame" effect:
    Double-clicking on it creates the layer and the shape.  By default, the text panel layer has a semi-transparent layer style applied to it and this has caused great grief for those who want a completely opaque background behind some text.  Not to worry, that's easily done.  To whet your appetite, here are a few effects that can be achieved with the text panel:
    Let's start with the "Big text" box:
    Create the text panel.
    Because we want an opaque panel, right-click on the shape in the Editor and select "Clear layer style".  POOF!  Instantly you've got an opaque white shape with no drop shadow.
    Move and resize the panel.  (It's still horizontal at this point.)
    Add some text (which will come in on its own layer).
    Size and position the text relative to the shape, and when you're satisfied, select both the shape layer and the text layer (using the Ctrl key) in the Layers panel and click on the "Link layers" icon at the bottom of the Layers panel.  This links the shape and text so they can be moved and rotated as one.  The layers wind up looking like this:
    Now, let's look at the "small text" box:
    Create the text panel.
    Position the panel and add and position some text as before.
    Because we want the text panel to be a dark grey (instead of the default white), with the text panel layer selected, select the "Create new fill or adjustment layer" icon at the bottom of the Layers panel and select "Hue/Saturation...".  Be sure to use the "Clip to layer" icon, and lower the "Lightness" value:
    This gives the nice transparent grey background so the white text shows up very well, even against the bright white of the clouds.
    Select all three of the layers and link them together:
    Finally, you can have some fun with the "Fancy" effects:
    Create the text panel.
    Position the panel, add some text, and set their positions.
    Add a "Hue/Saturation" adjustment layer as before (clipping it to the text panel shape layer).
    Colorize the text panel by using these settings:
    5.  Don't forget to link the layers together:
    6.  Double-click on the "fx" icon to the right of the text panel shape layer, which will bring up the "Layer effects" dialog box.  Here you can create the bevel and adjust the size and transparency of the drop shadow.
    You can also get this nice faded effect on the text panel:
    After following the steps listed above, add a mask layer to the text panel shape layer and draw a gradient fill on that mask layer to fade the layer.  I used a linear fill going from white to a dark gray because I wanted some of the text panel to always be showing:
    N.B.: Make sure you always clip the "Hue/Saturation" adjustment layer to the text panel shape layer so that the H/S adjustments only affect the text panel.
    That's it!  Enjoy!
    Ken

    Yes nice job.
    Thanks for posting this.
    MTSTUNER

  • Accessing the main timeline

    Hello,
    I have multiple instances of a movieclip (a1) within the main timeline.  These instances move around via tweening within the main timeline.  The instances also appear (are added) and disappear (are removed) while the main timeline is playing.
    Within the movieclip is this actionscript:
    (code)
    addEventListener(Event.ENTER_FRAME, ef);
    function ef(evt:Event):void
         trace(MovieClip(parent).currentFrame);
    (end code)
    As soon as an instance disappears... I get this typeError:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at test13_fla::a1_1/ef()
    The question then is - How can I access the main timeline from each instance (even when it is not currently on stage)?  Is this possible?  Any suggestions on how I can keep all of my code within the movieclip?
    Thanks in advance!
    -Jake

    Throughout the timeline the instances are in a motiontween followed by a blank keyframe. 
    To remove the event listener when it does dissappear I could do a addEventListener(Event.Removed, removeEventListenerFn);.... but I need a way to keep it.
    In my real project, each instance draws itself via drawRect and then put into a sprite and added to the main timeline.  Then within the event function (where it traces the maintimelines current frame)  I need all of the sprites to be removed when the main timeline gets to a certain frame#.  I know... confusing...
    I just need to find a way to access the main timeline while the instance is removed from the stage.
    If, for example, I did this...
    (code)
    addEventListener(Event.REMOVED, ef);
    var ccc:Number = 1;
    function ef(evt:Event):void
         trace("First Removed: " + MovieClip(root).currentFrame);
         addEventListener(Event.ENTER_FRAME, eg);
    function eg(evt:Event):void
         if(ccc < 10)
              trace("I am now removed");
         ccc++;
    (end code)
    ... I do not get any errors and I would get this in the output window:
    First Removed: 59
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed

  • How to access the cluster tables

    hi all
    Can anyone tel me Hw to retrieve the  text data from the cluster PCL1 .
    Thanks and Regards
    cnu

    Use macro for accessing the text data from PCL1.
        RP-IMP-C1-TX.
    Find below a sample code for extracting from P0019
    INCLUDE: RPC1TX00,  "Cluster TX: Infotype Texts - Cluster Key
             RPPPXD00,  "R/3 Data Definition for PCL1 and PCL2 Buffer
             RPPPXD10.  "Data Definition for PCL1, PCL2 Buffer Handler
        MOVE-CORRESPONDING IT0019 TO TX-KEY.
        MOVE '0019' TO  TX-KEY-INFTY.
        RP-IMP-C1-TX.
        LOOP AT PTEXT.
          MOVE PTEXT TO TMPTEXT.
        ENDLOOP.
      ENDLOOP.
    Reward if this was helpful.
    Regards
    Ravikumar

  • How to access properties of running workflow 2013 instances?

    Hi there,
    I am trying to figure out how I can access properties of a running workflow instance. I have created the following PowerShell:
    Add-PSSnapin microsoft.sharepoint.powershell
    $web = Get-SPWeb http://app-72b5c37f94da1d.apps.sharepoint2013.local/sites/appdev/SharePointWorkflowApp
    $wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
    $list= ($web.lists|where Title -eq "List1")
    $sub = $wfm.GetWorkflowSubscriptionService()
    $subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)
    $inst = $wfm.GetWorkflowInstanceService()
    $instances= $inst.Enumerate($subscriptions[0])
    $instance= $instances[0]
    $instance.Status
    $instance.UserStatus
    $instance.Properties
    I am not able to retrieve the arguments or variables via this route. Only UserStatus is a valid working option at this point.
    The variables and arguments of the sequence which I have configured via Visual Studio 2013's Workflow Designer, resulted in the following xaml:
      <x:Members>
        <x:Property Name="EenArg" Type="InArgument(x:String)" />
        <x:Property Name="argument1" Type="x:String" />
        <x:Property Name="argument2" Type="InOutArgument(x:String)" />
        <x:Property Name="strArg" Type="InOutArgument(x:String)" />
        <x:Property Name="intArg" Type="InOutArgument(x:String)" />
        <x:Property Name="dateTimeArg" Type="InOutArgument(x:String)" />
      </x:Members>
    None of which are propagated via de Properties collection. 
    What am I missing here?

    Hi,
    To access the properties of a workflow instance, here is a blog with code demos for your reference:
    http://ranaictiu-technicalblog.blogspot.com/2013/05/sharepoint-2013-workflow.html
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Input Text will not allow me to access the correct answer!

    Hi All
    i am trying to create a simple quiz in school. I have one test question which requires the answer to be -1.
    I have created Input text and assigned the variable answer for this question.
    I have a button with the following AS2 script:
    on (press, keyPress "<Enter>") {
        if(answer eq "-1" or answer eq "minus 1"
           or answer eq "Minus 1" or answer eq "Minus one" or answer eq "minus one")
        {_root.gotoAndStop(2)
        } else
        {_root.gotoAndStop(3)
    Firstly whatever you type the numerical keys are immobilised on the keyboard when the .SWF file is built
    Secondly I cannot enter the correct answer!! If I type in Minus 1 etc it goes to frame 3.
    I have tried flags rather than frame numbers - same problem.
    i have tried remaking the quiz as a  separate file.
    using CS4 and CS5 flash - windows 7 PC.
    Please help!!
    teacheRuss

A: Input Text will not allow me to access the correct answer!

Ned
Thanks for the reply. I had instances for all elements but had code on teh but (Instance Enter). I have tried your code with my instance names. The button is Q1 (I was going to add more if it worked). The vaiable name for the Insert text box is ans1 so I used the code below. I added the code to frame 1 in teh timeline. I think this is what you meant so a frame script as opposed to a buton script. i have always scriped buttons (very simple). I have played around with the trace(); function but i am not sure where to run it from. I have added it to the script below. I tried Q1 which is the button and ans1 (variable). It must be wrong as I cannot see any output. Last thing. Is it not right ot use eq and or?? I am using Actionscript 2.
The disabled keys is the same running the code on my mac and pc!
Q1.onRelease = function() {
    if(ans1.text == "-1" || ans1.text == "minus 1" || ans1.text == "Minus 1" || ans1.text == "Minus one" || ans1.text == "minus one") {
         _root.gotoAndStop(2)
     } else  {
         _root.gotoAndStop(3)
trace(Q1);

Ned
Thanks for the reply. I had instances for all elements but had code on teh but (Instance Enter). I have tried your code with my instance names. The button is Q1 (I was going to add more if it worked). The vaiable name for the Insert text box is ans1 so I used the code below. I added the code to frame 1 in teh timeline. I think this is what you meant so a frame script as opposed to a buton script. i have always scriped buttons (very simple). I have played around with the trace(); function but i am not sure where to run it from. I have added it to the script below. I tried Q1 which is the button and ans1 (variable). It must be wrong as I cannot see any output. Last thing. Is it not right ot use eq and or?? I am using Actionscript 2.
The disabled keys is the same running the code on my mac and pc!
Q1.onRelease = function() {
    if(ans1.text == "-1" || ans1.text == "minus 1" || ans1.text == "Minus 1" || ans1.text == "Minus one" || ans1.text == "minus one") {
         _root.gotoAndStop(2)
     } else  {
         _root.gotoAndStop(3)
trace(Q1);

  • Can not access the Instance Data of a Singleton class from MBean

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

  • Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    1) The best way to relocate the iTunes library folder is to move the entire iTunes folder with all subfolders to the new path, then press and hold down shift as start iTunes and keep holding until prompted to choose a library, then browse to the relocated folder and open the file iTunes Library.itl inside it.
    If you've done something different then provide some more details about what is where and I should be able to help.
    2) Purchases on the device should automatically transfer to a Purchased on <DeviceName> playlist, but it my depend a bit on whether automatic iCloud downloads are enabled. If there is a cloudy link then the transfer might not happen. You can use File > Devices > Transfer Purchases. In iTunes you should also check out iTunes Store > Quick Links > Purchased > Music > Not on this computer.
    3) Backup the device, then immediately restore it. In some cases you need to add a restore as new device into that equation. Obbviously not to be attempted until you're sure all your media is in your library. See Recover your iTunes library from your iPod or iOS device should it be needed.
    4) I believe there is complimentary 1 incident 90-day support with hardware purchases, but no free software support for iTunes itself. AppleCare gets you a different level of support.
    tt2

  • Maybe you are looking for