F8as2-displaying leading zeros in a dynamic text field

F8as2-
Background:
Currently I have to use two different text fields to display 10000 due to the different font sizes.
The 10 is a larger font and the 000 is a smaller font.  When I assign '0 'to the dynamic text fields of the smaller font I get just that a '0' not a '000' which is what I want.
Question:
Is there an easy way to display leading zeros in a dynamic text field?  Or can a dynamic text field have different character positions displayed in different font sizes?  or both?
Thanks for the help.

F8as2-
Thanks for the reply kglad.
Are for saying the best way to display numerically calculated numbers that need leading zeros and or different font sizes is to convert them to a string for display purposes with textFormatting??

Similar Messages

  • Leading zeros in dynamic text fields

    I have a dynamic text field that indicates the degree of
    rotation of a knob. I need the display to have three digits showing
    at all times. This means I need leading zeros from 0 to 99. ie,
    000, 001, 002, etc.
    Is there a way to do this numerically or do I have to change
    the numbers to strings and concatenate??
    Thanks,

    Yes, for the most part only strings can start with leading
    zeros.
    You might run into some troubles because Flash treats a
    leading zero as a sign that a number is octal, base-8.
    So if you were planning on using Number() to cast your values
    into numbers, don't! Instead use parseInt(someString,10).

  • Displaying leading zeroes

    Hi,
    I am facing a problem in displaying leading zeroes for a char in a BW report. This char has length 4 and it should show the value as 0ABC in the report but instead it displays just ABC. When checked the info providers, the data is right there.
    Technical details: length - 4, Conv Routine - ALPHA, BEx display - Key & text
    Could someone please throw some light on this?
    Thanks a lot in advance.

    Hi Bobs,
    Here is what I understood from your query;
    You have leading zeros for the char info object in the info provider but while running the query it is returning with the rest of the characters but not leading zeros?
    Yes while loading in to info provider ALPHA conversion does add any leading zeros according to the char size to load in to the info provider but while reporting it does the reverse ALPHA. but you have to check the values in the master data for the char info object where the default option for query results on char objects to retrieve key and text values from char object master tables. I think the master data for the char info object might not be have leading zeros.

  • Dynamic Text Field is not displaying foreign characters... HELP!

    I have a dynamic text field that is not displaying foreign characters properly. They appear as boxes.
    Here's what I've tried.
    Under properties for the text field, I clicked on the embed characters button. In there, I pasted all the special characters I would need and clicked okay. Shouldn't this be enough for the text to display properly? What am I missing? Please help...

    More info: I'm noticing that in the actual dynamic text field in my .FLA file, if I type a foreign character like é, it pops up as a block. My family font is set to New Caledonia... is it possible that New Caledonia doesn't have those particular glyphs? The thing that doesn't make sense to me though is, last year when I made this card, it worked fine with New Caledonia... Any help is greatly appreciated!!

  • Displaying images in dynamic text fields

    Hi, I am having some difficulty getting my images to display
    in a dynamic text field. The images are linked from a txt file with
    the <img src=""> tag however they are not showing up in the
    text area. The rest of the html are rendering fine except the image
    tag. My example online is here:
    www.supernaturalmedia.com.
    Here is the code I used in Flash:
    var style_sheet = new TextField.StyleSheet();
    var css_url = "global.css";
    style_sheet.load(css_url);
    news.StyleSheet = style_sheet;
    loadVariables("projects_news.txt", this.news);
    My css styles also isn't loadin so i temporarily am using
    html styles for formatting. I'd like to get the css to work as
    well.
    My movie is published as Flash Player 6, AS 2.0.
    I'd appreciate any helpful advice.
    Thanks,
    Stanton

    1. don't assign the stylesheet property of your textfield
    until loading of global.css is complete. ie, use the onLoad handler
    for stylesheets.
    2. you have movieclip images that are linked for export and
    you're using their linkage id in src property of the img
    tag?

  • Display leading zeros in the ALV

    Hello All,
    My requirement is to display leading zeros in the ALV. The leading zeros are not getting displayed. Please suggest how do I achieve this. I have tries NO_ZERO = ' ' and lzero = ' '.
    Thanks in advance.
    Regards,
    Anju

    Here is the Sample code for your ref
    type-pools: slis.
    data: begin of t_itab occurs 0,
           col1 type matnr,
           col2 type char10,
          end of t_itab.
    data: t_fieldcat type slis_t_fieldcat_alv,
          w_fieldcat type slis_fieldcat_alv.
    t_itab-col1 = 10.
    t_itab-col2 = 'A'.
    append t_itab.
    clear t_itab.
    t_itab-col1 = 11.
    t_itab-col2 = 'B'.
    append t_itab.
    clear t_itab.
    loop at t_itab.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input         = t_itab-col1
       IMPORTING
         OUTPUT        = t_itab-col1 .
       modify t_itab index sy-tabix.
    endloop.
    w_fieldcat-fieldname = 'COL1'.
    w_fieldcat-lzero = 'X'.
    append w_fieldcat to t_fieldcat.
    clear w_fieldcat.
    w_fieldcat-fieldname = 'COL2'.
    append w_fieldcat to t_fieldcat.
    clear w_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       IT_FIELDCAT                       = t_fieldcat
       I_SAVE                            = 'X'
      TABLES
        t_outtab                          = t_itab
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Bhavana

  • Display Leading Zeros in bex query

    Hi,
    I am new to BI and need to display leading zeros in bex report.
    There is an info-object billing number which is of type CHAR. The values, 00001 - 00010 has been given in the CSV file.
    when i generate the same in IP, the leading zeros are mentioned, but the same is not appearing in the bex query.
    I have tried ALPHA conversion but this has no affect on the output.
    How to achieve the same??
    thanks in advance for the answers

    Hi,
    To answer your question in detail, there is a  conversion routine at infoobject level( Tab- general ), that determines how the values are displayed in the front end. For ex, alpha conversion routine takes away the leading zeros when you display the value in query. ( 0001 displayed as 1 )
    Assuming this is custom infoobject, I would suggest you to remove the conversion routine from the infoobject. This will help you in displaying leading zeros in the report.
    However, you have to ensure that all the values loaded for this infoobject is properly alpha converted ( packed with leading zeros ) by adding a field routine in the transformation. This will avoid same values getting stored with different internal formats like 01,001 etc.
    Hope this explains.
    Thanks.

  • Display leading zeros in OLE

    Hi Friends,
    When I am writing report in OLE( excel ), some of the fields which are having leading zeros automatically deleted . It shoud not happen . I have to display leading zeros also.
    Please tell me which class and method to do this ...
    Thanks ,
    Varma

    Use OLE itself to set the formatting of the cell (or column itself) to character type
    * character type for columns
    data: h_columns        TYPE ole2_object,
          h_cell           TYPE ole2_object.
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'F:K'.
    set property of h_columns 'NumberFormat' = '@'.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = 14
        #2 = 7.
    SET PROPERTY OF h_cell 'Value' = '0001'.

  • HTML links won't display in Dynamic Text Field

    I am loading external text files in dynamic text fields on my
    webage. These texts contain html links (<a href="page.html"
    target="_blank">Click Here</a> and I have "render as HTML"
    on and "selectable" off in my dynamic text field. Also, I am
    loading a CSS file. Not only do I not have a hand cursor, but I do
    not even have any of the text from that piece of html code down.
    What is going on with this? Please respond asap, as I have been
    struggling with this for a day now. Here is the Actionscript for
    loading the CSS:
    var flash_css = new TextField.StyleSheet();
    flash_css.load("styles.css");
    flash_css.onLoad = function(success:Boolean) {
    if (success) {
    zloc_txt.styleSheet = flash_css;
    } else {
    trace("Error loading CSS file.");
    var zloc_lv:LoadVars = new LoadVars();
    zloc_lv.load("zloc.txt");
    zloc_lv.onLoad = function(success:Boolean) {
    if (success) {
    zloc_txt.text = this.content;
    } else {
    trace("unable to load text file.");
    zloc_txt.html = true;
    zloc_txt.editable = false;
    _global.styles.TextArea.setStyle("backgroundColor" ,
    "transparent");
    _global.styles.TextArea.setStyle("border styles" , "solid");
    Here is a sample of the text file code:
    &content=<span class="headline">Northwest Arkansas
    Locations</span>
    121 Main St.
    Russellville, AK 77801
    (626) 111-1111<br />
    <html><a href="
    http://www.mapquest.com"
    target="_blank">Click Here for Driving
    Directions</a></html><br />
    Thanks for the help,
    Chuck

    The error is here:
    zloc_txt.text = this.content;
    Even if you rendered the textfield as HTML, you still need to
    tell flash that the variable you are inserting is HTML. Therefore
    you need to use the htmlText property.
    zloc_txt.htmlText = this.content;

  • Linking a class to a dynamic text field to load XML data.

    Hi,
    I'm quite new to ActionScript and would be grateful for any help here.
    I want to load text into a dynamic text field (called 'about_tab') using  a class depending on the language selected (by clicking on a flag icon)  by the user.
    I managed to get this to work when the ActionScript was written directly  in the timeline, but am having problems with doing the same thing via a  class.
    This is my class file:
    package
    import flash.display.SimpleButton;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.events.Event;
    public class ChangeLang extends SimpleButton
    public function ChangeLang()
    addEventListener(MouseEvent.CLICK, switchLang);
    trace("ChangeLang class working");
    public function switchLang(event:MouseEvent):void
    var lang = event.target.name;
    var req:URLRequest = new  URLRequest("languages/"+lang+".xml");
    var loader:URLLoader = new URLLoader();
    var substance:XML;
    function xmlLoaded(event:Event):void
    trace("function xmlLoaded is running");
    substance = new XML(loader.data);
    about_tab.text =  substance.about_lbl;
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    loader.load(req);
    Here's one of my XML files (the other is the same except "About" is  written in German):
    <substance>
    <about_lbl>About</about_lbl>
    </substance>
    When I run it, it returns my trace statements that the class ChangeLang  and the function xmlLoaded are running, but no text appears in the  dynamic text field (I should/want to see the word 'About'). I get this  error message:
    1120: Access of undefined property about_tab
    The problem, I'm guessing, is in the part in red in my code. I think I need to target the text field in the display list by creating a  reference to it. If so, could someonw point out how I do this, or perhaps a tutorial that would help. I've tried adding the word stage (i.e.,stage.about_tab.text =  substance.about_lbl; ) but it still doesn't connect. I guess there's something really simple I'm missing, so I  apologize if this comes across as a stupid question
    Thanks for any help.

    Hello flashrocket!
    I'm also new to AS3 and I've just started using external classes and I think I know what you should do to put your code to work.
    Instead of using the text field you created inside your flash file, why don't you use the "TextField" class to create an instance of this object? It's the exact same thing as when you create and instantiate a new text field inside Flash.
    First, import flash.text.*; (includes classes like TextField, TextFieldAutoSize, TextFormat, TextFormatAlign, etc)
    Than you just have to create a var like
    public var about_tab : TextField;
    or
    public var about_tab : TextField = new TextField();
    then, to adjust the properties of this tab you use dotsyntax as if it where on your stage like:
    about_tab.x = 50; about_tab.alpha = .5; etc...
    you can even create a function to "config your textField"
              private function createAndConfigTextField() : void {
                   about_tab = new TextField(); //you only need this line if you
              // only typed something like "public var about_tab:TextField;
              // if instead you used "public var about_tab:TextField = new TextField(); outside
              // this function, just skip this first line because you already have an instance of
              // text field named "about_tab"...
                            about_tab.autoSize = TextFieldAutoSize.CENTER;
                   about_tab.background = true;
                   about_tab.border = true;
                   var aboutTextFormat : TextFormat = new TextFormat();
                   format.font = "Arial";
                   format.color = 0x000000;
                   format.size = 11;
                   format.bold = true;
                   format.align = TextFormatAlign.CENTER;
                   about_tab.defaultTextFormat = aboutTextFormat;
                   addChild(about_tab);
    This is just an example of what you can do... I hope you get it... let me know if you have any doubt...

  • Dynamic Text Field Wont Wrap Text

    I have a Dynamic Text field in my movie clip. This text field has embedded fonts and Behavior is set to Multiline.  When I add text to it, it wont display the text that wraps beyond the first line.
    var textField:TextField = tip_txt; // text field inside my movie clip
    trace("before textField.numLines = " + textField.numLines);
    textField.text = "test a verrrrry looooooooong striiiinnnnnnnnnnnggggggg";
    trace("after textField.numLines = " + textField.numLines);
    The trace commands show that the number of lines are increasing but Flash doesn't display the text beyond the first line.  Does anyone have any idea whats going on?
    Thanks!

    textField.autoSize = TextFieldAutoSize.LEFT;
    This fixed the issue : )

  • Connecting a CSS doc to an XML file, in a dynamic text field in Flash

    Hi all,
    I am trying to connect a CSS file such that it applies it
    self to the content of an XML file, viewed inside a dynamic text
    field. So far I have managed to gather the code that "calls" the
    contents of the XML file and also the code that calls the CSS file.
    However, when I test the flash movie I get "undefined" instead of
    the actual copy.
    Attached then is the the AS code, XML file, and CSS file. I
    hope you could help me connect everything together.
    And of course, THANKS!!
    -----AC------
    Scrolling Text XML by Digital Science |
    www.digitalscience.za.org
    /////////////Load XML Data/////////////
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    header = [];
    txt = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) {
    header
    = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
    txt
    = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
    gotoAndStop(11);
    } else {
    errorMsg.text = "Error loading XML";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("ewmn_content.xml");
    stop();
    import TextField.StyleSheet;
    var ss:StyleSheet = new StyleSheet();
    ss.onLoad = function() {
    txt_mc.styleSheet=this; // where yourTF is your textfield
    ss.load("jokes.css"); // where yourSS.css is your css file.
    -----XML----------
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/css" href="jokes.css"?>
    <JOKES>
    <ONE>Tirza Sapir</ONE>
    <JOKE>Founder and choreographer of the RikudNetto dance
    group, teacher and lecturer, researcher, documenter and
    choreographer within the framework of Eshkol-Wachman Movement
    Notation. She was Head of the School of the Arts of Dance at the
    Seminar Hakibbutzim College of Education, 2000–2007, where
    she established the Dance Theatre and the Practicing Teachers
    courses, and specialized training in Teaching and Treatment of
    Learning Disabilities by means of Eshkol-Wachman Movement Notation.
    She has written three books containing the movement scores of dance
    suites: Birds, Landscapes, and Hanukka Notebooks. Member of the
    Movement Notation Society, 1968–2008. Student and colleague
    of the late Professor Noa Eshkol who was the co-founder and
    inventor of Eshkol-Wachman Movement Notation.</JOKE>
    <ONE>Sharon Reshef-Armony</ONE>
    <JOKE>Head of the School for the Arts of dance at the
    Kibbutzim College of Education in Tel Aviv. Teaches EWMN,
    dance-theatre and composition. Choreographer of theatre plays and
    film. Selected works: Hunger (Tmuna Theatre 2003-09), Film - Live
    (Haifa Theatre 2007-08), Yakish &amp; Pupche (Gesher Theatre
    2007-09), Children of a lesser God (Beer Sheva Theatre 2008-09).
    M.Ed (1997) from Lesley College MA in Creative Arts in Learning.
    Doctoral student at ResCen, Middlesex University/ London.
    Dancing in Rikudnetto group since 1990.</JOKE>
    <ONE>Tally Ronen</ONE>
    <JOKE>M.Ed. at Lesley University in Integrating Arts in
    Learning.
    Educational instructor at Kibbutzim College of Education and
    teaching dance in schools and at Clore Center, Upper Galilee. Dance
    choreographer for children.
    Dancing in Rikudnetto group since 1991.</JOKE>
    <ONE>Nira Al-Dor, Ph.D</ONE>
    <JOKE>20 years of Teaching EWMN at the School of the
    Dance Arts in Kibbuzim College of Education and at the School of
    Arts in Tel Aviv. Her study was focused on the impact of learning
    EWMN on the development of coordination.
    Dancing in Rikudnetto group since 1986.</JOKE>
    <ONE>Henner Drewes</ONE>
    <JOKE>Lectures at the Kibbutzim College of Education in
    Tel Aviv on dance and notation related technology. In 2008 he
    started working as a research assistant at Salzburg University in
    the project Visualizing Dance Archives.
    He was awarded the Tanzwissenschaftwpreis NRW, Germany 2006
    for his research on 3D representation of movement and notation.
    Ph.D. (2002) at the University of Leipzig. He is the author
    of the software EW Notator, a 'word-processor' for creating EWMN
    scores.</JOKE>
    <ONE>Shlomit Ofer</ONE>
    <JOKE>M.A. at Haifa University at the Faculty of
    Education with distinction, and currently doctoral student there.
    Educational instructor and teacher of EWMN at Kibbutzim
    College of Education. Staging performances of dance theatre in the
    community.
    Dancing in Rikudnetto group since 1993.</JOKE>
    <ONE>Lilach Shalit</ONE>
    <JOKE>M.A. in Expressive Therapies with specialization
    in dance-movement therapy at Lesley University.
    Educational instructor and teacher of EWMN in the course for
    Dance-Theatre at Kibbutzim College of Education. Also teaching EWMN
    in the School for Advanced Studies of the college, course for
    Learning Disabilities, and at Orot College.
    Dance-movement therapist and team coordinator at 'Tom' school
    for learning disabilities and owner of a private clinic for
    dance-movement therapy.
    Dancing in Rikudnetto group since 1998.</JOKE>
    <ONE>Michal Manor-Amir</ONE>
    <JOKE>M.A. at the University of Leeds (Bretton Hall
    College and Israel Extention) in Arts Education specialization in
    Dance. Doctoral student at the Hebrew University of Jerusalem, in
    the Faculty of Humanities, the School of Education.
    Teaching movement in the Kibbutzim College of Education
    within preparatory courses of Dance, Dance-Theatre and within the
    Preschool course.
    A corrective teacher through movement and EWMN in elementary
    and high schools, and a national teacher-instructor at the dance
    supervisor's office in the Israeli ministry of education.
    Dancing in Rikudnetto group since 1998.</JOKE>
    <ONE>Amit Chesny-Bahari</ONE>
    <JOKE>B.Ed. at Kibbutzim College of Education.
    Teaching movement and dance to preschool and high school
    children.
    Dancing in Rikudnetto group since 2004.</JOKE>
    <ONE>Orly Yaakov</ONE>
    <JOKE>B.Ed. at Kibbutzim College of Education, and
    graduating from the special education faculty.
    Teaching EWMN and creative movement at elementary schools as
    well as special education school for children ages 6-21 with medium
    to deep retardation. Also teaching creative movement and
    preparation for ballet to preschool children.
    Dancing in Rikudnetto group since 2006.</JOKE>
    </JOKES>
    ------CSS-----
    JOKE
    COLOR: #333333;
    DISPLAY: block;
    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
    WHITE-SPACE: normal;
    font-size: 11px;
    MARGIN-BOTTOM: 15px;
    BODYBLD
    COLOR: #990000;
    DISPLAY: block;
    FONT-SIZE: 11pt;
    FONT-WEIGHT: bold;
    MARGIN-BOTTOM: 0px
    BODYBOLDUN
    COLOR: #00CCFF;
    DISPLAY: block;
    LINE-HEIGHT: normal;
    MARGIN-BOTTOM: 10px;
    TEXT-ALIGN: left;
    font-size: 11px;
    text-decoration: underline;
    font-weight: bold;
    ONE
    COLOR: #00CCFF;
    DISPLAY: block;
    LINE-HEIGHT: normal;
    TEXT-ALIGN: left;
    font-size: 14px;
    font-weight: bold;
    white-space: normal;
    QUESTION
    COLOR: red;
    DISPLAY: block;
    FONT-FAMILY: Arial;
    FONT-SIZE: larger;
    FONT-VARIANT: normal
    TITLE
    COLOR: black;
    DISPLAY: block;
    FONT-FAMILY: 'Arial Black';
    FONT-SIZE: 14pt
    CATEGORY
    FONT-FAMILY: Arial;
    FONT-SIZE: 8pt;
    FONT-VARIANT: small-caps;
    TEXT-TRANSFORM: uppercase

    In essence you can just do:
    TextField.text = XML.node1 + XML.node2;

  • Adding a progress loader to a dynamic text field / scrollPane

    I have a dynamic text field which is loading images from an external html.  This text is named scrollPaneImage and is a child of a movieClip called scrollPaneContent.  I then load scrollPaneContent into a scroll pane named scrollPane
    When the user interacts with my swf different images are loaded into scrollPaneImage.  Since some of the images take a few seconds to load, I'd like there to be a progress loader displayed in the scrollpane.
    I have tried adding the progress event listner to the dynamic text, the movie clip and the scrollpane and cannot get it to respond or track the loading.
    scrollPaneContent.addEventListener(ProgressEvent.PROGRESS,reportProgress);
    function reportProgress(e:ProgressEvent):void {
        trace(e.bytesLoaded + " loaded out of " + e.bytesTotal);
         trace("LOADED");
    Can anyone suggest what I might be doing wrong or of another approach?
    thanks in advance,
    Josh

    Hi KGLAD.  Thanks for the response.  Yes my code is a little messy.  Here I have included everything and tried to do a little cleaning.  Is there enough code here for you to get an idea of how/when things are firing?
    import com.google.maps.LatLng;
    import com.google.maps.Map;
    import com.google.maps.MapEvent;
    import com.google.maps.MapType;
    import com.distriqt.gmaps.kml.utils.*;
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.TweenLite;
    import flash.geom.Point;
    import com.greensock.plugins.*;
    TweenPlugin.activate([AutoAlphaPlugin]);
    import com.google.maps.controls.NavigationControl;
    import com.google.maps.controls.MapTypeControl;
    import com.google.maps.controls.OverviewMapControl;
    import com.google.maps.overlays.GroundOverlay;
    import com.google.maps.overlays.GroundOverlayOptions;
    import com.google.maps.LatLng;
    import com.google.maps.LatLngBounds;
    import com.google.maps.MapMouseEvent;
    import com.google.maps.controls.*;
    import com.google.maps.overlays.Marker;
    import com.google.maps.InfoWindowOptions;
    import com.google.maps.overlays.MarkerOptions;
    import com.anttikupila.utils.JPGSizeExtractor;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.net.URLLoader;
    import fl.controls.UIScrollBar;
    import flash.events.Event;
    import fl.events.ScrollEvent;
    import flash.sampler.NewObjectSample;
    [Embed(source="ICONS/PHOTO_BLACK.png")]var photoIcon:Class;
    [Embed(source="ICONS/BLOG_BLACK.png")]var blogIcon:Class;
    scrollPane
    // GMAP PARAMETERS
    var map:Map = new Map();
    map.key = "map key";
    //map.key = "api key";
    //define the size of the map extent....
    map.sensor = "false";
    map.setSize(new Point(stage.stageWidth, stage.stageHeight));
    map.addEventListener(MapEvent.MAP_READY, onMapReady);
    map.addEventListener(MapEvent.MAP_READY, createmarkers);
    map.addEventListener(MapEvent.MAP_READY, createMarkerArrays);
    map.addEventListener(MapEvent.MAP_READY, createPhotoPingers);
    this.addChild(map);
    map.setSize(new Point(stage.stageWidth, stage.stageHeight));
    //on map ready params
    function onMapReady(event:Event):void
    map.setCenter(new LatLng(48,-113.5), 8, MapType.PHYSICAL_MAP_TYPE);
    map.enableScrollWheelZoom();
    map.disableContinuousZoom();
    //Marker options for a photo piece
    var photoMarkerOptions:MarkerOptions = new MarkerOptions();
    photoMarkerOptions.icon = new photoIcon();
    photoMarkerOptions.hasShadow=false;
    //Marker options for a blog piece
    var blogMarkerOptions:MarkerOptions = new MarkerOptions();
    blogMarkerOptions.icon = new photoIcon();
    blogMarkerOptions.hasShadow=false;
    //load xml tester
    var pntloader:URLLoader = new URLLoader();
    var pntxml:XML = new XML();
    pntloader.addEventListener(Event.COMPLETE, loadpntXML);
    pntloader.load(new URLRequest("map_feed.xml"));
    // create an array of jpgs to index
    var JPGIndexArray:Array = new Array();
    //Create array that will be populated with points
    var pointsArray:Array = new Array();
    //Load the XML
    function loadpntXML(e:Event):void {
        pntxml=new XML(e.target.data);
        pntxml.ignoreWhite = true;
         for (var i:int = 0; i< pntxml.row.length(); i++){
         pointsArray[i]="mrk"+i;
         JPGIndexArray[i]="JPG"+i;
         //trace(pntxml);
    //Create the markers and add them to the map
    function createmarkers(event:Event):void
         for (var i:Number = 0; i < pntxml.row.length(); i++) {
         var markerOptions:MarkerOptions = new MarkerOptions();
          if (pntxml.row[i].TYPE=="PHOTO")
               markerOptions.icon = new photoIcon();
               markerOptions.tooltip = "Photo";
               markerOptions.hasShadow=false;
          else if(pntxml.row[i].TYPE=="BLOG")
               markerOptions.icon = new blogIcon();
               markerOptions.tooltip = "Blog Entry";
               markerOptions.hasShadow=false;
          else
               null     
          pointsArray[i] = new Marker(new LatLng(pntxml.row[i].LAT,pntxml.row[i].LONG),markerOptions);
         markerA.push(pointsArray[i]);
          map.addOverlay(pointsArray[i]);
          pointsArray[i].addEventListener(MapMouseEvent.CLICK,indexCalledMarkerRecord);
          pointsArray[i].addEventListener(MapMouseEvent.CLICK,scrollPanePopulate);
    // PING PHOTO DIMENSIONS BEFORE LOADING //
    var je : JPGSizeExtractor = new JPGSizeExtractor( );
    je.addEventListener( JPGSizeExtractor.PARSE_COMPLETE, jeLoadHandler );
    je.addEventListener( JPGSizeExtractor.PARSE_FAILED, jeParseFailed );
    function createPhotoPingers(event:Event):void{
         for (var k:Number=0; k <pntxml.row.length(); k++){
         JPGIndexArray[k]=new JPGSizeExtractor();
         JPGIndexArray[k].debug = false;
         JPGIndexArray[k].addEventListener(JPGSizeExtractor.PARSE_COMPLETE, jeLoadHandler );
         trace("madeit");
         pingPhotoUrls();
    function pingPhotoUrls():void
         for (var i:Number = 0; i < pntxml.row.length(); i++) {     
          var calledMarkerUrl=pntxml.row[i].URL_OF_CONTENT;
          JPGIndexArray[i].extractSize(calledMarkerUrl);     
    var JPG1=null;
    function jeLoadHandler(e:Event) : void {
         trace(e.currentTarget.width + "x" + e.currentTarget.height );
         imageWidths.push(e.currentTarget.width);
    function jeParseFailed( event : Event ) : void {
         trace( "Parse failed" );
    var imageWidths = new Array;
    // FUNCTIONS FOR INDEXING CALLED MARKERS//
    //Create blank array for use in indexing
    var markerA:Array=[];
    //VAR FOR USE IN INDEXING CALLED MARKER
    var pointindex=null;
    //INDEX CALLED MARKER POINT XML RECORD
    function indexCalledMarkerRecord(e:MapMouseEvent):void{
         pointindex=genIndexPos(markerA,Marker(e.currentTarget));
         //trace(pntxml.row[pointindex].DESC);
    //FUNCTION FOR INDEXING CALLED MARKER
    function genIndexPos(a:Array,e:Marker):uint{
         for(var i:uint=0;i<a.length;i++){
              if(a[i]==e){
                   return i;               
                   return null;
    //           SCROLLPANE FUNCTIONS              //
    this.addChild(scrollPane);
    scrollPane.setSize(255,300);
    scrollPane.x=-200;
    scrollPane.y=-200;
    scrollPane.alpha=0;
    scrollPaneContent.mouseEnabled=false;
    spHeader.closeBox.addEventListener(MouseEvent.CLICK, function(eMouseEvent):void
                                                                TweenLite.to(scrollPane, .5,{autoAlpha:0,overwrite:true});                                                            
    spHeader.forDrag.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void
              scrollPane.startDrag();          
    spHeader.forDrag.addEventListener(MouseEvent.MOUSE_UP, function (e:MouseEvent):void
              scrollPane.stopDrag();
    spHeader.forDrag.buttonMode=true;
    spHeader.forDrag.useHandCursor=true;
    spHeader.width=300;
    scrollPane.source = scrollPaneContent;
    scrollPaneContent.scrollPaneText.autoSize='left';
    scrollPaneContent.scrollPaneImage.autoSize='center';
    scrollPaneContent.scrollPaneImage.autoSize=TextFieldAutoSize.CENTER;
    scrollPaneContent.mouseEnabled=false;
    scrollPaneContent.scrollPaneText.condenseWhite = true;
    // Add listener.
    scrollPane.addEventListener(Event.COMPLETE, completeListener);
    scrollPaneContent.addEventListener(ProgressEvent.PROGRESS,reportProgress);
    function completeListener(event:Event):void {
    trace('Scrollpane content loaded');
    function reportProgress(e:ProgressEvent):void {
        trace(e.bytesLoaded + " loaded out of " + e.bytesTotal);
        trace("LOADED");
    function scrollPanePopulate(event:Event){     
         //show scroll pane
         scrollPane.x=33;
         scrollPane.y=33;
         TweenLite.to(scrollPane, .5,{autoAlpha:1,overwrite:true});
         TweenLite.to(spHeader, .5,{autoAlpha:1,overwrite:true});
         //create the temp variables
         var calledMarkerIndex=pntxml.row[pointindex].ID;
         var calledMarkerDate=pntxml.row[pointindex].DATE;
         var calledMarkerDescription=pntxml.row[pointindex].DESC;
         var calledMarkerContent=pntxml.row[pointindex].URL_OF_CONTENT;     
         var imgWidth=JPGIndexArray[pointindex].width;
         var imgHeight=JPGIndexArray[pointindex].height;
         scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
         var imgBoxHeight=scrollPaneContent.scrollPaneImage.height;
        var txtHeight=scrollPaneContent.scrollPaneText.height;
        var contentHeight=(imgBoxHeight+txtHeight);
        scrollPane.setSize(300,(contentHeight+15));     
         //size the text box
         scrollPaneContent.scrollPaneText.width=270;
         //if image is wide or tall, scale accordingly and create a string that will be used
         if(imgWidth>=imgHeight){          
              var imgSource:String = "<img src="+"'"+calledMarkerContent+"'"+"width='"+250+"'"+"height='"+150+"'"+"/>";                    
              var calledImgHgh=160;          
         else
              var imgSource:String = "<img src="+"'"+calledMarkerContent+"'"+"width='"+110+"'"+"height='"+167+"'"+"/>";          
              var calledImgHgh=177;          
         //fill in the text
         scrollPaneContent.scrollPaneImage.htmlText=imgSource;
         //scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;     
         //pan the map to the called position
         map.panTo(pointsArray[calledMarkerIndex-1].getLatLng())
         //add the header to the SP and scale accordingly
         scrollPane.addChild(spHeader);
         spHeader.x=-1;
         spHeader.y=1;
         spHeader.width=299;
         if (txtHeight>=250){          
              scrollPane.setSize(300,275);          
              scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription+"<br><br>";
         if (txtHeight<=5){
              scrollPane.setSize(300,200);
              scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
         if (txtHeight>=5){
              scrollPane.setSize(300,275);
              scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription+"<br><br>";
         // CREATE TEMP VARIABLES FOR POSITIONING AND PLACE DYNAMIC TEXT
         var scTextY=scrollPaneContent.scrollPaneText.y;
         var scImageY=scrollPaneContent.scrollPaneImage.y;
         var scTextHeight=scrollPaneContent.scrollPaneText.height;
         scrollPaneContent.scrollPaneText.y=scImageY+calledImgHgh;
         //update the scrollpane and reset the scrollbar
         scrollPane.update();
         scrollPane.verticalScrollPosition=(0);
         scrollPane.verticalScrollBar.height=270;
         scrollPane.verticalScrollBar.x=281;
         scrollPane.verticalScrollBar.y=3;
    spHeader.alpha=0;
    this.addChild(spHeader);
    var photoMarkersArray=new Array();
    var photoMarkersIndexArray=new Array();
    //CREATE ARRAY OF PHOTO MARKERS
    function createMarkerArrays(e:Event):void{
    for (var j:int=0; j<pntxml.row.(TYPE=="PHOTO").ID.length(); j++){
              var tempMarkerIndex=pntxml.row.(TYPE=="PHOTO").ID[j];
              var tempMarkerRef="mrk"+tempMarkerIndex;
              photoMarkersArray.push(tempMarkerRef);
              photoMarkersIndexArray.push(tempMarkerIndex);

  • If else conditional statements for dynamic text fields (as 2.0)

    This is about a self assesment quiz.There will be four options and each one has a scale from1-5 ie "option a" has 1mark, "option b" has 2marks,"option c" has 3 marks, "option d" has 4marks and "option e" has 5 marks and we count the answerd and we display the scor for example if there are 20 question in it if they answered "option e" 5 times the score will be
    25 and option d 5 times the score will be 20,anf if "option c" for 5 times the score will be 15,and "option b" for 3 times  the score will be 6 and "option a" two times the score will be 2, and we add up all the score and display in a dynamic text field called "scor" and the total score is 68.And i have another dynamic text field called "tsc" where i have to display the tags like excellent , good, better ......ect.
    Till now every thing is fine but i am unable to compare them it is displaying excellent even if i get 10 marks, i am unable to configure where i am going wrong.
    If the score is greater than 55 "tsc" should display Excellent, if the score is greater than 41 or less than 55 "tsc" should display Best, if the score is greater than 26 or less than 40 "tsc" should display Better,if the score is none of the above "tsc" should display Poor.
    This is my code on the submit button:
    on (release) {
        gotoAndStop("sQ");
        if (scor>=55) {
            tsc = "Excellent";
        } else if (scor == 41 && scor<=55) {
            tsc = "Best";
        } else if (scor == 26 && scor<=40) {
            tsc = "Better";
        } else if (scor == 10 && scor<=25) {
            tsc = "Good";
        } else {
            tsc = "Poor";
    where:
    "sQ" is the frame name where i am displaying the score details
    "scor" is the var name for the dynamic text field for displaying total score
    "tsc" is the var name for the dynamic text field for displaying the tags llike good, Excellent, better, poor.....etc
    Plese help.......

    Use trace commands to make sure that what you think you are processing is what is actually hapenning.
    Your middle conditionals are not written as you described them... any "==" should be ">="
    It is recommended you get away from using the textfield var option... it can be troublesome to work with.  Just assign an instance name to the textfield and assign the values to its text property... for instance, say you name it tscField, then you would use tscField.text = "Excellent";
    Also, realize that the gotoAndStop command will not happen until after all the code executes in case that matters
    on (release) {
        gotoAndStop("sQ");
        trace(scor);
        if (scor>=55) {
            tsc = "Excellent";
        } else if (scor >= 41 && scor<=55) {
            tsc = "Best";
        } else if (scor >= 26 && scor<=40) {
            tsc = "Better";
        } else if (scor >= 10 && scor<=25) {
            tsc = "Good";
        } else {
            tsc = "Poor";

  • Embed Fonts in Dynamic Text Fields

    Hey, I am relatively new around here although I've been a
    member for years. I am just now starting to utilize my account. I
    do have a question in regards to embedding fonts in Flash 8. I have
    read up on this numerous places and haven't been able to find a
    solution that works for me, whether this my user error or not is
    still TBD.
    I am loading text from a XML document into Flash dynamic text
    fields. I need to be using a handwritting font for these text
    fields. After embedding the handwritten font they are not
    displaying in my dynamic fields but are displaying in my static
    text fields that am I also using on the site. I am controlling my
    dynamic text fields w/ an external stylesheet. I believe I must do
    something "additional" for these dynamic text fields but haven't
    figured out what that is, any help anyone can offer is much
    appreciated! Thanks.

    floateronline wrote:
    > Hey, I am relatively new around here although I've been
    a member for years. I
    > am just now starting to utilize my account. I do have a
    question in regards to
    > embedding fonts in Flash 8. I have read up on this
    numerous places and haven't
    > been able to find a solution that works for me, whether
    this my user error or
    > not is still TBD.
    >
    > I am loading text from a XML document into Flash dynamic
    text fields. I need
    > to be using a handwritting font for these text fields.
    After embedding the
    > handwritten font they are not displaying in my dynamic
    fields but are
    > displaying in my static text fields that am I also using
    on the site. I am
    > controlling my dynamic text fields w/ an external
    stylesheet. I believe I must
    > do something "additional" for these dynamic text fields
    but haven't figured out
    > what that is, any help anyone can offer is much
    appreciated! Thanks.
    the question is a bit too general. There are many ways to
    approach it, from copies
    of text fields with that font off stage, to embedded outlines
    and linkage in the library.
    My guess is that somewhere on the way you did not fully
    complete the outline embed options.
    Either done incorrectly or you miss some action.
    Mind to post detail explanation how you embed the outlines?
    Best if you post an example
    file for us to check.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

Maybe you are looking for