How wordWrap in cfgrid?

Here is the code in my form

< name cfform = "displayProjects" method = "post" preservedata = "Yes" format = "flash" action = "" id = "myformid" width = "800" height = "1000" wmode = "transparent" > "
< cfformgroup type = "Control Panel" >
< cfformgroup type = "vbox" width = "800" label = "Coastal projects" >
< name cfgrid = format 'project' = colheaderbold 'flash' = 'Yes' query = "projectNames" height = "500" style = "padding-left: 150px" >
< cfgridcolumn header = 'Project name' name = "txtProjectName" >
< / controls cfgrid >
< / cfformgroup >
< / cfformgroup >
< / cfform >

How wordWrap column name of the project? or grow its width dynamically?

In order to get the text in the cell, you must add this before the grid style:

Tags: ColdFusion

Similar Questions

  • How to alternate the color of the lines in the html cfgrid controls

    Hi all

    How can I alternate the color of the lines in html cfgrid?

    I do not have access to CFIDE/scripts/ajax/resources/ext/css/ext-all.css which is where the css styles are preserved according to firebug

    Thank you

    goodychurro1 wrote:

    How can I alternate the color of the lines in html cfgrid?

    Hi goodychurro1,

    The cfgrid attribute you're looking for is "striperows.  Optionally, you can also use the attribute "striperowcolor".  Regarding your question in the other thread on link href/selection of a grid, you can use the following block of cfscript to create the query of 'q' in the example I posted in the other thread (if you're not on CF10).

    q = queryNew ("myID, myString", "integer, varchar");

    queryAddRow (q, 3);

    querySetCell (q, "MyID", 1, 1);

    querySetCell (q, "MyID", 2, 2);

    querySetCell (q, "MyID", 3, 3);

    querySetCell (q, "myString", "one", 1);

    querySetCell (q, "myString", "two", 2);

    querySetCell (q, "myString", "three", 3);

    Reference:

    - controls cfgrid

    Thank you

    -Aaron

  • How can I get title Wordwrap a Panel?

    Is there a way to set the title of a multiline sign? I have a panel where the title is dynamic. I don't know how long will be the title. As it works now, the the title occaisionally gets cut. Is there a way to wordwrap title a Panel?

    " < mx:Panel id ="mySchoolPanel""

    "title =" myTitle{}"

    "width ="230"

             x="710" y="150"

    headerHeight ="50" >

    Thank you.

    -Laxmidi

    The logic of the layout of the Panel seems to assume a single line of text in the title, so to get the skin you must extend the class. I had a go at it below - will probably need a few adjustments:

    package
    {
        import mx.containers.Panel;

    public class WrappingPanel extends Panel
        {
            // Hard coded padding above and below title text. Should be broken-out
            // into a style.
            private static const HEADER_PADDING : int = 6;
           
            protected override function createChildren():void
            {
                super.createChildren();
               
                titleTextField.wordWrap = true;
            }
           
            protected override function getHeaderHeight():Number
            {
                // Set the header height dynamically based on the height of the title
                return titleTextField.measuredHeight + HEADER_PADDING * 2;
            }
           
            protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            {
                super.updateDisplayList( unscaledWidth, unscaledHeight );
               
                // Set the height of the title to fit all text
                titleTextField.height = titleTextField.measuredHeight;
               
                // Position the title
                titleTextField.y = HEADER_PADDING;
            }
        }
    }

  • HOW to: Filter data in an html CFGRID with the defined query attribute tag

    Does anyone know how can I filter data in an html cfgrid, not through a link from AJAX, but perhaps by exposing some of the features of the code behind the controls cfgrid EXT?

    Any help would be greatly appreciated.

    --
    Jorge loyo

    I have it!

    MY ENTRY:

    <>
    ID = "searchString".
    name = "searchString".
    Type = "text".
    OnKeyUp is "ColdFusion.Grid.getGridObject('dg'). GetDataSource () .filterBy (myfilterfunc)"/ >

    MY FUNCTION

    MY GRID:

    <>
    name = "dg".
    Query = "employees".
    format = "html" >



  • How can I wordwrap a grid column header

    I tried the word property of packaging and nothing happened.  Obviously, something else has to happen to make this work.

    What is it?

    If the label is inside a datagrid control, you must specify the property of the Datagrid to true "variableRowHeight' and

    the datagridcolumn wordWrap = "true"

  • I would like to know how to double space on the notebook in a paragraph, how to register and send to another computer and number pages? can anyone help? Thank you!

    Please someone help I'am new to the computer world and I would like to know if anyone out there can help understand me how to double space on the workpad words and how I can save and send it to another computer for printing. Can also how to number the pages? And also I can use see fate on this workpad vista? Thank you.

    Joseph Monteleone,
    Thank you for visiting the Microsoft Answers community forum.

    Notepad is a very limited text editor, so you can't really do a lot of formatting.  Double-spaced, the only way is to put two 'statements' at the end of each line.  You can format the font, and set the page layout for printing, but apart from turn, wordwrap who speaks all the formatting, you can do it.

    To save a file, just go to file, save money, find the folder you want to save it in (don't forget remember where you saved it), name, and click Save.

    To send it to another computer on your network, you can choose the drive you want to move on the network and copy and paste, or drag and drop it.  Or you can go to the computer that you want to put on, navigate to the drive on your computer where you saved, and then copy and paste or drag and drop it.

    Let us know if you need more information.
    Thank you
    Gloria
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • WordWrap on desktop hp2510

    How do you turn OFF wordwrap on a deskjet hp 2510 please.

    I want to print a .txt (text) file.

    One solution would be to cut the file before printing (with a python for example script) on a line width max - but how many characters/line should there be?

    Hello

    Depending on the font and size, you can't tell how many characters in a single line. Because they are text (txt) files, you can activate the ON / OFF wordwrap and you must REGISTER first then open again to print.

    Kind regards.

  • How to make a morse code translator in AS 3.0

    Hi everyone, thank you for posting my message.

    I want to do a morse code translator.

    What is morse code?

    (the morse code is used by Navy pilots to communicate using the light and/or the sound)

    (each alphabet is designated by the Department of transport points and dashes. being short-lived and dashes being longer)

    It is to her.

    I want an area of dynamic text on top of the screen in flash player (swf)(input field)

    and below it I need another text to the output area. (this text box must be unwritable if possible)

    and I need a button to convert (this button text is translated)

    How it works?

    I have to input alphabets in the text above field and when I press on translate button it should show the points and the indents referred to this character.

    and vice versa.

    Oh and I need for as 3.0 (I need everything inside a movieclip so that the room, next frame previous frame options do not work in flash player)

    I am familiar with some scripts.

    so I need writing scripts for a single character that I have who will copy for each character.

    Please help me on this

    Thanks for reading this message loooooong.

    hoping for some scripts.

    This is a basic model.

    First code will work when you put it on the Flash timeline. You just need to compile the swf.

    If you feel that you are comfortable with the classes of second - class variation.

    Read the comments.

    import flash.events.Event;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFieldType;
    import flash.text.TextFormat;
    import flash.utils.Dictionary;
    
    // map of letters and integers regualar expressions to Morse code conventions
    var charMap:Dictionary;
    // five spaces per convention
    var wordSeparator:String = "       ";
    // three spaces per convention
    var letterSeparator:String = "   ";
    var input:TextField;
    var output:TextField;
    var prompt:TextField;
    
    init();
    
    function init():void
    {
              createMap();
              drawUI();
    }
    
    function drawUI():void
    {
              drawInput();
              drawOutput();
              drawPrompt();
              placeUI();
    }
    
    /**
     * Places UI elements and positions them relative to each other
     */
    function placeUI():void
    {
              addChild(prompt);
              addChild(input);
              addChild(output);
              prompt.x = input.x = output.x = prompt.y = 20;
              input.y = prompt.y + prompt.height;
              output.y = input.y + input.height + 10;
    }
    
    /**
     * Creates prompt text field
     */
    function drawPrompt():void
    {
              prompt = new TextField();
              prompt.defaultTextFormat = new TextFormat("Arial", 11, 0x004040);
              prompt.multiline = output.wordWrap = false;
              prompt.autoSize = TextFieldAutoSize.LEFT;
              prompt.text = "enter text:"
    }
    
    /**
     * Creates output text field
     */
    function drawOutput():void
    {
              output = new TextField();
              output.defaultTextFormat = new TextFormat("Arial", 12, 0x000000, "bold");
              output.multiline = output.wordWrap = false;
              output.border = true;
              output.borderColor = 0x008040;
              output.background = true;
              output.backgroundColor = 0xDFFFEF;
              output.width = 500;
              output.height = 22;
    }
    
    /**
     * Creates input text field
     */
    function drawInput():void
    {
              input = new TextField();
              input.defaultTextFormat = new TextFormat("Arial", 12);
              input.type = TextFieldType.INPUT;
              input.restrict = "A-Z 0-9";
              input.multiline = input.wordWrap = false;
              input.border = true;
              input.borderColor = 0x808080;
              input.background = true;
              input.backgroundColor = 0xF0F0F0;
              input.width = 500;
              input.height = 22;
              input.addEventListener(Event.CHANGE, onInput);
    }
    
    /**
     * Handles input text field change event
     * @param          e
     */
    function onInput(e:Event):void
    {
              var outString:String = input.text;
              // append word separator to words
              outString = outString.replace(/\b\w+\b/g, addWordSeparator);
              // append letter separator to letters
              outString = outString.replace(/\w/g, addLetterSeparator);
              // loop through the map and replace characers with corresponding Morse codes
              for (var prop:Object in charMap)
                        outString = outString.replace(RegExp(prop), charMap[prop]);
              output.text = outString;
    }
    
    /**
     * Used in String.replace() to inject word separator
     * @return
     */
    function addWordSeparator():String
    {
              return [arguments[0], wordSeparator].join("");
    }
    
    /**
     * Used in String.replace() to inject letter separator
     * @return
     */
    function addLetterSeparator():String
    {
              return [arguments[0], letterSeparator].join("");
    }
    
    /**
     * Creates mapping of alphanumerical characters to Morse code conventions
     */
    function createMap():void
    {
              // international convention
              charMap = new Dictionary();
              charMap[/A/g] = ".-";
              charMap[/B/g] = "-...";
              charMap[/C/g] = "-.-.";
              charMap[/D/g] = "-..";
              charMap[/E/g] = ".";
              charMap[/F/g] = "..-.";
              charMap[/G/g] = "--.";
              charMap[/H/g] = "....";
              charMap[/I/g] = "..";
              charMap[/J/g] = ".---";
              charMap[/K/g] = "-.-";
              charMap[/L/g] = ".-..";
              charMap[/M/g] = "--";
              charMap[/N/g] = "-.";
              charMap[/O/g] = "---";
              charMap[/P/g] = ".--.";
              charMap[/Q/g] = "--.-";
              charMap[/R/g] = ".-.";
              charMap[/S/g] = "...";
              charMap[/T/g] = "-";
              charMap[/U/g] = "..-";
              charMap[/V/g] = "...-";
              charMap[/W/g] = ".--";
              charMap[/X/g] = "-..-";
              charMap[/Y/g] = "-.--";
              charMap[/Z/g] = "--..";
              charMap[/0/g] = "-----";
              charMap[/1/g] = ".----";
              charMap[/2/g] = "..---";
              charMap[/3/g] = "...--";
              charMap[/4/g] = "....-";
              charMap[/5/g] = ".....";
              charMap[/6/g] = "-....";
              charMap[/7/g] = "--...";
              charMap[/8/g] = "---..";
              charMap[/9/g] = "----.";
    }
    

    Version of the class:

    package
    {
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.text.TextField;
              import flash.text.TextFieldAutoSize;
              import flash.text.TextFieldType;
              import flash.text.TextFormat;
              import flash.utils.Dictionary;
    
              public class Morse extends Sprite
              {
                        // map of letters and integers regualr expressions to Morse code conventions
                        private var charMap:Dictionary;
                        // five spaces per convention
                        private var wordSeparator:String = "       ";
                        // three spaces per convention
                        private var letterSeparator:String = "   ";
                        private var input:TextField;
                        private var output:TextField;
                        private var prompt:TextField;
    
                        public function Morse()
                        {
                                  init();
                        }
    
                        private function init():void
                        {
                                  createMap();
                                  drawUI();
                        }
    
                        private function drawUI():void
                        {
                                  drawInput();
                                  drawOutput();
                                  drawPrompt();
                                  placeUI();
                        }
    
                        /**
                         * Places UI elements and positions them relative to each other
                         */
                        private function placeUI():void
                        {
                                  addChild(prompt);
                                  addChild(input);
                                  addChild(output);
                                  prompt.x = input.x = output.x = prompt.y = 20;
                                  input.y = prompt.y + prompt.height;
                                  output.y = input.y + input.height + 10;
                        }
    
                        /**
                         * Creates prompt text field
                         */
                        private function drawPrompt():void
                        {
                                  prompt = new TextField();
                                  prompt.defaultTextFormat = new TextFormat("Arial", 11, 0x004040);
                                  prompt.multiline = output.wordWrap = false;
                                  prompt.autoSize = TextFieldAutoSize.LEFT;
                                  prompt.text = "enter text:"
                        }
    
                        /**
                         * Creates output text field
                         */
                        private function drawOutput():void
                        {
                                  output = new TextField();
                                  output.defaultTextFormat = new TextFormat("Arial", 12, 0x000000, "bold");
                                  output.multiline = output.wordWrap = false;
                                  output.border = true;
                                  output.borderColor = 0x008040;
                                  output.background = true;
                                  output.backgroundColor = 0xDFFFEF;
                                  output.width = 500;
                                  output.height = 22;
                        }
    
                        /**
                         * Creates input text field
                         */
                        private function drawInput():void
                        {
                                  input = new TextField();
                                  input.defaultTextFormat = new TextFormat("Arial", 12);
                                  input.type = TextFieldType.INPUT;
                                  input.restrict = "A-Z 0-9";
                                  input.multiline = input.wordWrap = false;
                                  input.border = true;
                                  input.borderColor = 0x808080;
                                  input.background = true;
                                  input.backgroundColor = 0xF0F0F0;
                                  input.width = 500;
                                  input.height = 22;
                                  input.addEventListener(Event.CHANGE, onInput);
                        }
    
                        /**
                         * Handles input text field change event
                         * @param          e
                         */
                        private function onInput(e:Event):void
                        {
                                  var outString:String = input.text;
                                  // append word separator to words
                                  outString = outString.replace(/\b\w+\b/g, addWordSeparator);
                                  // append letter separator to letters
                                  outString = outString.replace(/\w/g, addLetterSeparator);
                                  // loop through the map and replace characers with corresponding Morse codes
                                  for (var prop:Object in charMap)
                                            outString = outString.replace(RegExp(prop), charMap[prop]);
                                  output.text = outString;
                        }
    
                        /**
                         * Used in String.replace() to inject word separator
                         * @return
                         */
                        private function addWordSeparator():String
                        {
                                  return [arguments[0], wordSeparator].join("");
                        }
    
                        /**
                         * Used in String.replace() to inject letter separator
                         * @return
                         */
                        private function addLetterSeparator():String
                        {
                                  return [arguments[0], letterSeparator].join("");
                        }
    
                        /**
                         * Creates mapping of alphanumerical characters to Morse code conventions
                         */
                        private function createMap():void
                        {
                                  // international convention
                                  charMap = new Dictionary();
                                  charMap[/A/g] = ".-";
                                  charMap[/B/g] = "-...";
                                  charMap[/C/g] = "-.-.";
                                  charMap[/D/g] = "-..";
                                  charMap[/E/g] = ".";
                                  charMap[/F/g] = "..-.";
                                  charMap[/G/g] = "--.";
                                  charMap[/H/g] = "....";
                                  charMap[/I/g] = "..";
                                  charMap[/J/g] = ".---";
                                  charMap[/K/g] = "-.-";
                                  charMap[/L/g] = ".-..";
                                  charMap[/M/g] = "--";
                                  charMap[/N/g] = "-.";
                                  charMap[/O/g] = "---";
                                  charMap[/P/g] = ".--.";
                                  charMap[/Q/g] = "--.-";
                                  charMap[/R/g] = ".-.";
                                  charMap[/S/g] = "...";
                                  charMap[/T/g] = "-";
                                  charMap[/U/g] = "..-";
                                  charMap[/V/g] = "...-";
                                  charMap[/W/g] = ".--";
                                  charMap[/X/g] = "-..-";
                                  charMap[/Y/g] = "-.--";
                                  charMap[/Z/g] = "--..";
                                  charMap[/0/g] = "-----";
                                  charMap[/1/g] = ".----";
                                  charMap[/2/g] = "..---";
                                  charMap[/3/g] = "...--";
                                  charMap[/4/g] = "....-";
                                  charMap[/5/g] = ".....";
                                  charMap[/6/g] = "-....";
                                  charMap[/7/g] = "--...";
                                  charMap[/8/g] = "---..";
                                  charMap[/9/g] = "----.";
                        }
    
              }
    
    }
    
  • AS3: How to get the size of a dynamically created text field

    I'm importing text from an XML file and lines of text to display in the text separated under the other fields. How can I set the value y of each text field following so that there is little space (40 pixels or more) in the field above, regardless of the length of the text? Here is my current code. Any help would be greatly appreciated.

    var textArray:Array = new Array();
    for (var i: int; i < myXML.TOPIC [0].) QUERY.length (); i++) {
    var textField:TextField = new TextField();
    textField.htmlText = myXML.TOPIC [0]. QUERY [i]. QUESTION;
    textField.x = 100;
    Here's my problem... I want the value of is based on the height of all the previous text fields that have been created

    textField.y is 100 + (40 * i);.
    textField.border = true;
    textField.width = 800;
    textField.textColor = 0 x 000000;
    textField.multiline = true;
    textField.wordWrap = true;
    textField.selectable = false;
    addChild (textField);
    textArray.push (textField);
    }

    Separate the variable of the loop that you update in the loop to keep track of the current value of y.  The current value of there would be updated to the previous value, the height of the textfield newest once it was filled with text.

  • How to redirect a page in PHP after submission of user?

    Hi all...

    I created a basic contact/comment form and when I click on the button 'Submit' everything works well, and it sends an email.  Perfect.  A problem though...  It performs a redirect to a new page and it echos a line of small 'Thank You!'.  How to return the user to the page of the contact form on the website (or any other page also?  I'll paste the below short/simple PHP code...

    Any direction on this subject would be appreciated.  Thank you!

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"

    < title > < /title > customer survey

    < / head >

    < body > <? PHP # Script 1.0 - contactlist.php

    If ($_SERVER ['REQUEST_METHOD'] == 'POST') {}

    If (! empty($_POST['first']) & &! empty($_POST['last']) & &! empty($_POST['email'])) {}

    $body = "name: {$_POST ['first']} \nLast name: {$_POST ['last']} \nEMail address: {$_POST ['email']} \nContactez phone number: {$_POST ['phone']} \nContactez preference: {$_POST ['contactvia']} \nBest Contact time: {$_POST ['timepref']} \nComments:\n {$_POST ['comment']}";

    $body = wordwrap ($body, 70);

    mail (' [email protected]', 'NEW customer investigation presentation', $body, ' to: {$_POST ['email']} "" ");

    echo "< p > < em > thank you for your inquiry!  We will answer you as soon as POSSIBLE! < /em > < / p > ';

    $_POST = array();

    } else {}

    echo "< style p =" make-weight: bold; color: #C60 "> please fill in the form!" < /p > ';

    }

    }

    ? >

    < / body >

    < / html >

    OK, first of all, get rid of the $_SERVER ['REQUEST_METHOD'].  Now if a form is set to display your address it will be processed.  Spambots like these forms because you're really not checking if your form has been submitted.  Usually, you should only need to check if $_POST ['something'] is presented.  I know that I have not said this before, but I should have.

    Then, move the at the beginning of the document before the

    Now, remove the "else" statement

    Then remove the line "echo Thank you" and the $_POST = array(); line.  $_POST is a superglobal and always a table, so you never have to define it. And if you redirect someone, there is nothing you need to do the echo.

    So now, your code should be down for:

    <>

    If (isset($_POST['submit']) &! empty($_POST['submit')) //Test if clicked on button named submit submit and not empty

    {

    If (! empty($_POST['first']) &! empty($_POST['last']) &! empty($_POST['email'])) {}

    $body = "name: {$_POST ['first']} \nLast name: {$_POST ['last']} \nEMail address: {$_POST ['email']} \nContactez phone number: {$_POST ['phone']} \nContactez preference: {$_POST ['contactvia']} \nBest Contact time: {$_POST ['timepref']} \nComments:\n {$_POST ['comment']}";

    $body = wordwrap ($body, 70);

    mail (' [email protected]', 'NEW customer investigation presentation', $body, ' to: {$_POST ['email']} "" ");

    Header ('Location: url.php "");  Redirect to the new url if form is submitted

    }

    }

    ?>

    Just move this text "Please fill out the form" to the actual page above the form.  If the user has sent the form, they will then get redirected, if not, they see the page.  Make sense?

  • CFREE, CFGRID works does not after installation of CF9

    Just installed CF9 64bits and CF9.0.1 update on a Windows Server 2008 R2 box, using the IIS web server.  Everything works fine, but when I try to run. CFM files that contain < CFTREE > or < CFGRID > tags, I get a Java error 'OBJECT NOT FOUND' in IE 8.  And nothing is displayed in the sections CFTREE and CFGRID controls.  I checked the Java x 32 and x 64 are installed and work properly, testing on the Java web site.

    Firefox reports the problem in this way:

    load: class coldfusion.applets.CFTreeApplet.class not found.

    java.lang.ClassNotFoundException: coldfusion.applets.CFTreeApplet.class

    I made a dozen CF 5, 7 and 9 installs on different OS and never had this problem.  However, has been the first time, I installed CF on a Win Server 2008 R2 server.

    Nobody knows what can cause this and I hope a speedy resolution?  Without having to uninstall and reinstall CF.  If Java is installed and works well, what the result of improper installation?

    Would appreciate ideas, suggestions on how to solve this problem.  If the only way to correct one-install/re-install, can BTW, you just remove via Add/Remove Programs, and then reinstall?  Or are the hacks and other registry processes required for disassembly of the CF?  Not sure how 'clean up' the uninstallation must be, since I've had the chance to have having to do a uninstall-reinstall.  Thank you very much for any help or advice.

    Gary

    Problem solved.  Once more, thanks to Google, the only answer anyone having a similar problem could provide, would do an uninstall and re-install.  So I tried this and it worked.  Now the. CFM files that use CFFREE, CFGRID and othe related to Java code, normally.

    However, I just installed CF 9.0and not the 9.0.1 patch.  As a reminder, it was on Windows Server 2008 R2 with IIS 7.5.

    In case anyone cares, when I did the uninstall, I did nothing fancy, no registry hacks.  Just run uninstaller from Add/Remove programs and delete the folder root the C:\ColdFusion9 and all it's content (uninstall program left about 180 MB of files in there), then restarted.  Then reinstalled 9.0.

    I'm almost afraid to install the 9.0.1 patch on Windows Server 2008 R2, since everything works OK.  Because in the previous installation, I ran the 9.0.1 patch just after 9.0 and never tested the CFTREE/CFGRID tags up to version 9.0.1.  So I don't always know with 100% certainty, if it was a bad installation, or something to do with the 9.0.1, version that caused the problem (assumed it was a bad installation).

    If I decide to apply the patch, I will test and post the results here.  I'm sure I will at some point, if for nothing other than curiosity and preferred to have the latest update installed.  If anyone has any ideas on the question of whether the patch on this OS could cause the problem reappears, please let us know.  Thank you.

    Gary

  • StyleableTextField multiline and WordWrap

    Hello

    Why are there 2 different properties for this? Shouldn't one implies the other? If I want to multiline, I want viceversa and word wrapping.

    How are they different? When I just use wordWrap multiline or anything simply?

    Thank you.

    multiline wouldn't say the user can press ENTER to start a new line

    WordWrap simply means a single long line is wrapped, but the user cannot do it with the Enter key

  • How to copy a line and the textFormat of textField

    the example of my problem is:

    I have 2 textFiled there are:

    1. myTextFied (to store the original text)

    2 displayText (to show a line of original text)

    I have try this:

    myTextField.htmlText = "< B > THIS IS A TEXT LINE 1 < /B > \n ' +.

    ' < I > This IS a LINE of TEXT 2 < /I > \n "+

    ' < U > This IS a LINE of TEXT 3 < /U > ';

    myTextField is narrow and I set myTextField.wordWrap = true;

    If the result of myTextField screen like this:

    It IS a TE XT

    LINE 1

    This IS a TEXT

    LINE 2

    This IS a TEXT

    LINE 3

    and I use displayText to get the text of line 2 and line 3 of myTextField:

    so I try this:

    displayText.htmlText = myTextField.getLineText (1);

    displayText.htmlText += myTextField.getLineText (2);

    but the result of displayText like this:

    LINE 1, there IS a TEXT

    It is not even the original textFormat.

    I want it to appear like this

    LINE 1

                                                                 THIS IS A TEXT

    How do I know this. Guy you can please help me!

    Thank you

    and sorry for my English.

    After you added the text in text, you can get a line format in myTextField, and then define the respective displayText:

    FMT var = myTextField.getTextFormat (lineStartIndex, lineEndIndex);

    displayText.setTextFormat (fmt, start, end);

  • How to assign variables itemrender in a global public variable of my application.


    Hi friends,

    How to assign values to render internal elements in a global public variable. You can see example below.

    List an itemrender, the itemrender breast I use the data grid. The dataGrid control have itemrender.now I tried the values to assign public variable in my application data grid itemrender, but is it from the error... How can I slove u this problem Any One can help me.

    Example:

    public var myData:arrayCollection;

    < mx:List variableRowHeight = "true" dataChange = "validateNow ()" width = "900" id = "Lst_userlist" verticalScrollPolicy = "off" horizontalScrollPolicy = "off" "
    buttonMode = "true" >

    < mx:itemRenderer >

    < fx:Component >

    < mx:VBox paddingTop = "-5" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >

    < fx:Script >
    <! [CDATA]

    override public function set data(value:Object):void
    {
    ------

    -----
    }

    []] >

    < / fx:Script >

    < mx:VBox id = "vbox_grid" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" width = paddingLeft '890' = "10" paddingTop = "5".

    backgroundColor = "#317152" color = "#FFFFFF" >

    < mx:DataGrid visible = "false" includeInLayout = "false" height = "100%" id = "membershipGrid" alternatingItemColors = "[#DCDCDC, F8F8FF #]".

    "5" paddingLeft = horizontalScrollPolicy = "off" color = 'black '.
    horizontalGridLines = "false" verticalScrollPolicy = 'auto' verticalGridLines = "false" rowHeight = "25".
    borderSkin = "{null}" showHeaders = 'true' borderVisible = "false" dataProvider = "{data.dataCollection}" width = "900" > "

    < mx:columns >

    < mx:DataGridColumn width = "180" headerText = "Name" minWidth = "150" sortable = "true" wordWrap = "true" >
    < mx:itemRenderer >
    < fx:Component >

    < mx:HBox horizontalScrollPolicy = "off" >

    < fx:Script >
    <! [CDATA]

    override public function set data(value:Object):void
    {
    -----

    -----

    }

    function Click_Name (): void
    {

    outerDocument.myData = data;  Here the error came

    }

    []] >

    < / fx:Script >
    < mx:Image id = "fileimg" buttonMode = "true" toolTip = "This is organization at the home page of the user" / >
    < s:Label id = "lbl_Gridcloumn_name" width = "200" buttonMode = "true" textDecoration = "underline" click = "Click_Name ()" / > "

    < / mx:HBox >
    < / fx:Component >

    < / mx:itemRenderer >
    < / mx:DataGridColumn >

    < / cloumn >

    < / datagrid >

    Error:

    MyData property possibly access not defined through a reference with static type com.istmanagement.views:ProgramAcessRights_ComponentInnerClass3.

    Thank you

    Mamoudou R.

    Have you tried outerDocument.outerDocument.myData?

  • SphereGallery: how to add MouseOver effect in ArrayObject

    Hello
    The following code block represents a sphere which is made from multiple photos. The project contains jpg small thumbnails and their corresponding pictures that are loaded when thumbs are clicked of course.
    I have a problem to find how these small thumbs changes color when they are clicked and to stay in this State/color, so that the user knows what inches he was clicking on, when he returns to the "Council".

    I'm putting a function nested inside the following function:

    Code:
    function setUpPics():void {
         
         //first circle
         thumbsArray[0]=[new Bitmap(new Small1(70,53))];
         
         function thumbsClicked(e:MouseEvent):void {
         thumbsArray[0].visible=false;
    
    if Small1 clicked, then color it RED...  something like this... 
    
    }

    but I can't understand how to do this, and if this is the right way to do it. The "Small1" is the name of liaison for the thumb of small1.jpg which is in the library.

    Here's the complete code with comments:

    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.filters.GlowFilter;
    import flash.events.MouseEvent;
    
    
    
    //align, scaleMode are Public Properties 
    stage.align = StageAlign.TOP;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    
    var posX = 390; 
    
    //Number=stage.stageWidth/2;
    
    var posY = 300;
    //:Number=stage.stageHeight/2;
    
    
    stage.dispatchEvent(new Event(Event.RESIZE)); //
    
    
    
    /*
    The radius of the sphere, 'rad'. You can change it if you wish
    especially if you use thumbnails of a different size than our thumbnails.
    */
    
    var rad:Number=200;
    
    /*
    The position of 'board' that will be defined later. 'board' is the main
    container containing the sphere and the black background
    that reponds to mouse actions.
    */
    
    
    /*
    The size of thumbnails. Change t4e values to reflect the size of your
    images.
    */
    
    var thumbWidth:Number=75;
    
    var thumbHeight:Number=58;
    
    /*
    The thumbnail images have been imported to the Library and linked to AS3
    under the names 'Small1', 'Small2',....,'Small46'. The corresponding
    Bitmap objects will be stored in the array 'thumbsArray'.
    */
    
    var thumbsArray:Array=[];
    
    /*
    The addresses of the images corresponding to the thumbnails are stored
    in 'picsArray'. The images will be loaded at runtime when the user
    clicks on each thumbnail.
    */
    
    var picsArray:Array=[];
    
    /*
    The Bitmap object corresponding to each thumbnail will be placed
    in a Sprite, holdersArray[i][j], as its child. We have to do this
    to make thumbnails responsive to mouse clicks.
    */
    
    var holdersArray:Array=[];
    
    /*
    In order to depth-sort images on the sphere, we will need to keep
    track of their midpoints and the position of each midpoint in 3D.
    The midpoints will be stored in 'midsArray'.
    */
    
    var midsArray:Array=[];
    
    /*
    
    All our arrays are organized to reflect that placement of thumbnails.
    For example, thumbsArray is an array of arrays, thumbsArray[i], where
    i corresponds to the number of each circle. thumbsArray[i][j] is the
    j-th image on the i-th of the seven circles.
    */
    
    var jLen:Vector.<Number>=new Vector.<Number>();
    
    jLen=Vector.<Number>([1,6,10,12,10,6,1]); //number of images on the each circle 
    
    
    var thetaStep:Vector.<Number>=new Vector.<Number>();
    
    thetaStep=Vector.<Number>([0,60,36,30,36,60,0]); // number of degrees on circle 
    
    //The vertical angle between circles.
    
    var phiStep:Number=30;
    
    var phiTilt:Vector.<Number>=new Vector.<Number>();
    
    phiTilt=Vector.<Number>([-90,-60,-30,0,30,60,90]);
    
    //The next four variables are related to auto-rotation 
    //and rotation by the user.
    
    var autoOn:Boolean=true;
    
    var manualOn:Boolean=false;
    
    var prevX:Number;
    
    var prevY:Number;
    
    this.transform.perspectiveProjection.fieldOfView=60;
    
    //We define and position the container 'board'.
    
    var board:Sprite=new Sprite();
    
    
    this.addChild(board);
    
    
    board.x=posX;
    
    board.y=posY;
    
    //We call the function that draws the border and the background
    //of 'board'.
    
    drawBoard();
    
    //Settings for our dynamic text boxes present on the Stage.
    
    infoBox.mouseEnabled=false;
    
    infoBox.wordWrap=true;
    
    infoBox.text="Press and move the mouse over the sphere & double click a thumbnail to load an image.";
                             
    loadBox.mouseEnabled=false;
    
    loadBox.wordWrap=true;
    
    loadBox.text="";
    
    loadBox.visible=false;
    
    /*
    When the user double-clicks on a thumbnail, the corresponding image
    will be loaded into 'loader' - an instance of the Loader class.
    'loader' is a child of the Sprite, 'photoHolder', which is a child
    of the MainTimeline.
    */
    
    var photoHolder:Sprite=new Sprite();
    
    this.addChild(photoHolder);
    
    photoHolder.x=-30;
    
    photoHolder.y=105;
    
    var loader:Loader=new Loader();
    
    photoHolder.addChild(loader);
    
    photoHolder.visible=false;
    
    /*
    We will literally 'build' a shere of thumbnails by positioning
    them in a Sprite called 'spSphere'. 
    */
    
    var spSphere:Sprite=new Sprite();
    
    board.addChild(spSphere);
    
    spSphere.x=0;
    
    spSphere.y=0;
    
    spSphere.z=rad;
    
    
    spSphere.graphics.moveTo(10, 20);
    
    
    setUpPics();
    
    buildSphere();
    
    spSphere.rotationY=0;
    
    spSphere.rotationX=0;
    
    spSphere.rotationZ=0;
    
    
    spSphere.filters=[new GlowFilter(0x1C3E75,1.0,6.0,6.0,2)];
    
    rotateSphere(0,0,0);
    
    setUpListeners();
    
    
    
    function drawBoard():void {
         
           board.graphics.clear();
         
           board.graphics.lineStyle(1,0xFFFFFF, -100);
         
           board.graphics.beginFill(0xFFFFFF, -100);
         
           board.graphics.drawRect(-140,-140,380,380);
         
           board.graphics.endFill();
           
         }
    
          
    function setUpListeners():void {
          
               var i:int;
         
               var j:int;
            
               this.addEventListener(Event.ENTER_FRAME,autoRotate);
              
                board.addEventListener(MouseEvent.ROLL_OUT,boardOut);
              
              board.addEventListener(MouseEvent.MOUSE_MOVE,boardMove);
              
              board.addEventListener(MouseEvent.MOUSE_DOWN,boardDown);
              
              board.addEventListener(MouseEvent.MOUSE_UP,boardUp);
                
                loader.contentLoaderInfo.addEventListener(Event.COMPLETE,doneLoad);
         
               loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadingError);
                
                
                photoHolder.addEventListener(MouseEvent.CLICK,holderClicked);
                
               for(i=0;i<7;i++){
              
                  for(j=0;j<jLen[i];j++){
                        
                        holdersArray[i][j].doubleClickEnabled=true;
                   
                       holdersArray[i][j].addEventListener(MouseEvent.DOUBLE_CLICK,picClicked);
                   
                     }
                   
                }
                            
                
         }
    
         
    function holderClicked(e:MouseEvent):void {
         
         board.visible=true;
         
         photoHolder.visible=false;
         
         infoBox.text="Press and move the mouse over the sphere to rotate. DOUBLE CLICK a thumbnail to load an image.";
         
         manualOn=false;
         
         autoOn=true;
         
    }
    
    
    
    function picClicked(e:MouseEvent):void {
         
         var targName:String="";
         
         var i:int;
         
         var j:int;
         
         targName=e.currentTarget.name;
         
         i=int(targName.charAt(3));
         
         j=int(targName.substring(5,targName.length));
         
         board.visible=false;
         
         loader.load(new URLRequest(picsArray[i][j]));
         
         infoBox.text="";
         
         loadBox.text="Loading...";
    
        loadBox.visible=true;
         
    }
    
    
    function loadingError(e:IOErrorEvent):void {
         
         loadBox.text="There has been an error loading the image. The server may be busy. Refresh the page and try again.";
         
    }
    
    
    function doneLoad(e:Event):void {
         
         infoBox.text="Click the image to close it, and to return to the gallery.";
         
         photoHolder.visible=true;
         
         loadBox.text="";
    
        loadBox.visible=false;
    
      }
      
    //Listeners responsible for mouse rotations and auto-rotation.
      
    
    function autoRotate(e:Event):void {
         
              if(autoOn && !manualOn){
                   //velocity of rotation 
                    spSphere.transform.matrix3D.prependRotation(-1.5,Vector3D.Y_AXIS);
                    
                    zSortPics();
                   
                }
                
         } 
         
     function boardOut(e:MouseEvent):void {
                   
                   autoOn=true;
                   
                   manualOn=false;
                   
         }
         
    function boardDown(e:MouseEvent):void {               
                   
                 prevX=board.mouseX;
                   
                   prevY=board.mouseY;
                        
                   autoOn=false;
                   
                   manualOn=true;
                   
         }
         
    function boardUp(e:MouseEvent):void {
                   
                   manualOn=false;
                   
         }
         
         
         function boardMove(e:MouseEvent):void {
               
                      var locX:Number=prevX;
                        
                        var locY:Number=prevY;
              
                        if(!autoOn && manualOn){
                        
                        prevX=board.mouseX;
                        
                        prevY=board.mouseY;
                        
                        rotateSphere(prevY-locY,-(prevX-locX),0);
                        
                        e.updateAfterEvent();
                        
                        }
         }
    
    
    function thumbsClicked(e:MouseEvent):void {
    
    thumbsArray[0].visible=false;
    
    
    
    }
    
    
    
    function setUpPics():void {
         
         //first circle
         thumbsArray[0]=[new Bitmap(new Small1(70,53))];
         picsArray[0]=["pic1.jpg"];
         
         //second circle 
         thumbsArray[1]=[new Bitmap(new Small2(70,53)),new Bitmap(new Small3(70,53)),new Bitmap(new Small4(70,53)),new Bitmap(new Small5(70,53)),new Bitmap(new Small6(70,53)),new Bitmap(new Small7(70,53))];
         
         picsArray[1]=["pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg","pic6.jpg","pic7.jpg"];
         
         
         thumbsArray[2]=[new Bitmap(new Small8(70,53)),new Bitmap(new Small9(70,53)),new Bitmap(new Small10(70,53)),new Bitmap(new Small11(70,53)),new Bitmap(new Small12(70,53)),new Bitmap(new Small13(70,53)),new Bitmap(new Small14(70,53)),new Bitmap(new Small15(70,53)),new Bitmap(new Small16(70,53)),new Bitmap(new Small17(70,53))];
         
         picsArray[2]=["pic8.jpg","pic9.jpg","pic10.jpg","pic11.jpg","pic12.jpg","pic13.jpg","pic14.jpg","pic15.jpg","pic16.jpg","pic17.jpg"];
         
         thumbsArray[3]=[new Bitmap(new Small18(70,53)),new Bitmap(new Small19(70,53)),new Bitmap(new Small20(70,53)),new Bitmap(new Small21(70,53)),new Bitmap(new Small22(70,53)),new Bitmap(new Small23(70,53)),new Bitmap(new Small24(70,53)),new Bitmap(new Small25(70,53)),new Bitmap(new Small26(70,53)),new Bitmap(new Small27(70,53)),new Bitmap(new Small28(70,53)),new Bitmap(new Small29(70,53))];
         
         picsArray[3]=["pic18.jpg","pic19.jpg","pic20.jpg","pic21.jpg","pic22.jpg","pic23.jpg","pic24.jpg","pic25.jpg","pic26.jpg","pic27.jpg","pic28.jpg","pic29.jpg"];
         
         thumbsArray[4]=[new Bitmap(new Small30(70,53)),new Bitmap(new Small31(70,53)),new Bitmap(new Small32(70,53)),new Bitmap(new Small33(70,53)),new Bitmap(new Small34(70,53)),new Bitmap(new Small35(70,53)),new Bitmap(new Small36(70,53)),new Bitmap(new Small37(70,53)),new Bitmap(new Small38(70,53)),new Bitmap(new Small39(70,53))];
         
         picsArray[4]=["pic30.jpg","pic31.jpg","pic32.jpg","pic33.jpg","pic34.jpg","pic35.jpg","pic36.jpg","pic37.jpg","pic38.jpg","pic39.jpg"];
         
         thumbsArray[5]=[new Bitmap(new Small40(70,53)),new Bitmap(new Small41(70,53)),new Bitmap(new Small42(70,53)),new Bitmap(new Small43(70,53)),new Bitmap(new Small44(70,53)),new Bitmap(new Small45(70,53))];
         
         picsArray[5]=["pic40.jpg","pic41.jpg","pic42.jpg","pic43.jpg","pic44.jpg","pic45.jpg"];
         
         thumbsArray[6]=[new Bitmap(new Small46(70,53))];
         
         picsArray[6]=["pic46.jpg"];
         
         
    }
    
    
    //We literally build our sphere.
    
    function buildSphere():void {
         
         var i:int;
         
         var j:int;
         
         var tStep:Number;
         
         var pStep:Number=phiStep*Math.PI/180;
         
         for(i=0;i<7;i++){
              
              holdersArray[i]=[];
              
              midsArray[i]=[];
              
              tStep=thetaStep[i]*Math.PI/180;
              
              for(j=0;j<jLen[i];j++){
                   
                   midsArray[i][j]=new Vector3D(rad*Math.sin(i*pStep)*Math.sin(j*tStep),-rad*Math.cos(i*pStep),-rad*Math.sin(i*pStep)*Math.cos(j*tStep));
                        
                   holdersArray[i][j]=new Sprite();
              
                  holdersArray[i][j].name="pic"+String(i)+"_"+String(j);
                   
                   holdersArray[i][j].addChild(thumbsArray[i][j]);
                   
                   thumbsArray[i][j].x=-thumbWidth/2;
                   
                   thumbsArray[i][j].y=-thumbHeight/2;
                   
                   spSphere.addChild(holdersArray[i][j]);
                   
                   holdersArray[i][j].x=midsArray[i][j].x;
                   
                   holdersArray[i][j].y=midsArray[i][j].y;
                   
                   holdersArray[i][j].z=midsArray[i][j].z;
                   
                   holdersArray[i][j].rotationX=phiTilt[i];
                   
                   holdersArray[i][j].rotationY=-j*thetaStep[i];
                   
                   }
              
         }
         
           zSortPics();
         
    }
    
    //'zSortPics' depth-sorts all thumbnails
    
    function zSortPics():void {
         
         var distArray:Array=[];
              
         var dist:Number;
              
         var i:int;
         
         var j:int;
         
         var k:int;
              
         var curMatrix:Matrix3D;
              
         var curMid:Vector3D;
              
         curMatrix=spSphere.transform.matrix3D.clone();
              
         while(spSphere.numChildren>0){
         
              spSphere.removeChildAt(0);
              
              }
              
              for(i=0;i<7;i++){
                   
                   for(j=0;j<jLen[i];j++){
                   
                   curMid=curMatrix.deltaTransformVector(midsArray[i][j]);
              
                  dist=curMid.z;
              
                  distArray.push([dist,i,j]);
              
                   }
              
              }
              
           distArray.sort(byDist);
           
           for(k=0;k<distArray.length;k++){
                   
                spSphere.addChild(holdersArray[distArray[k][1]][distArray[k][2]]);
                
                holdersArray[distArray[k][1]][distArray[k][2]].alpha=Math.max(k/(distArray.length-1),0.5);
                
              }
              
         
         
    }
    
    function byDist(v:Array,w:Array):Number {
         
          if (v[0]>w[0]){
              
              return -1;
              
           } else if (v[0]<w[0]){
              
              return 1;
         
            } else {
              
              return 0;
           }
           
       }
       
    //The function that rotates the sphere in response to the user moving the mouse.
    
    
    function rotateSphere(rotx:Number,roty:Number,rotz:Number):void {
         
           spSphere.z=0;
         
           spSphere.transform.matrix3D.appendRotation(rotx,Vector3D.X_AXIS);
         
           spSphere.transform.matrix3D.appendRotation(roty,Vector3D.Y_AXIS);
         
           spSphere.transform.matrix3D.appendRotation(rotz,Vector3D.Z_AXIS);
           
           spSphere.z=rad;
           
           zSortPics();
         
         
    }

    "The content of this table mentions the names of link in the holdersArray [i] [j] (who owns the thumbsArray [1] = [new Bitmap (newSmall2 (70,53)), new Bitmap (new Small3()... )]). etc etc etc)"

    thumbsClasses is an array of instances of classes in the library.

    In th function onThumbClick, you are referring to 'this' - it relates to the current content, i.e. timeline and there is not another _color property. If you want to tween thumb - you must refer to e.currentTraget:

    Tweener.addTween (e.currentTarget, {scaleX:1, scaleY: 1, time: 1, transition: "easeoutelastic"});

Maybe you are looking for