Label Height Incorrect

I have some code that creates a label, then is supposed to use the height of that label to determine where to put another one below it.  The problem is that the height being returned is always 22 whether it's one line or two and changing the font size doesn't change it either.  These labels are being created in an array.  Here's some sample code:
Outside of Array:
var myFont:Font = new helvetica_bold();
var text_format:TextFormat = new TextFormat();
text_format.font = myFont.fontName;
text_format.size = 14;
text_format.align = "center";
Inside of Array:
//////// Add Label 1
var text_string1:String = xmlData.Product[i].name;
var label1:Label = new Label();
label1.move(xpos,ypos);
label1.width = 200;
label1.wordWrap = true;
label1.text = text_string1;
label1.autoSize = TextFieldAutoSize.CENTER;
label1.textField.antiAliasType = AntiAliasType.ADVANCED;
label1.setStyle("embedFonts", true);
label1.setStyle("textFormat", text_format);
addChild(label1);
//////// Add Label 2
var text_string2:String = xmlData.Product[i].brand;
var label2:Label = new Label();
trace(label1.height);        // This always returns 22
label2.move(xpos,ypos + label1.height);
label2.width = 200;
label2.wordWrap = true;
label2.text = text_string2;
label2.autoSize = TextFieldAutoSize.CENTER;
label2.textField.antiAliasType = AntiAliasType.ADVANCED;
label2.setStyle("embedFonts", true);
label2.setStyle("textFormat", text_format);
addChild(label2);
Because the labels can be one line or two lines, I need that height to be dynamically generated.  Any ideas on how to have the label height returned accurately?  Should I use a different text object instead?
Thanks!

i forgot to increment i in that loop:
var prevY:Number=0;
for(var i:uint=0;i<whatever;i++){
var l:Label=new Label();
// assign text and format
l.y=prevY;
prevY+=l.height;
// which will fail with components, use:
this.addEventListener(Event.ENTER_FRAME,f);
var prevY:Number=0;
var i:uint=0;
var l:Label;
function f(e:Event){
if(i<whatever){
if(l!=null){
prevY=l.height
i++;
l=new Label();
// assign text and format and this should be a function of i, so it will/may vary with each loop
l.y=prevY;
} else {
this.removeEventListener(Event.ENTER_FRAME,f);

Similar Messages

  • Changing Quiz "Default Labels" for Incorrect Message for Captivate 5.5

    Hi Experts,
    I am trying to change the "default labels" for incorrect message for my existing Quiz slides. However, it does not get reflected. Is there a way I can change, e.g., the default label for incorrect message from "...press Y to continue" to "xyz" for my existing quiz slide and get that reflected.
    Regards,
    Roshni

    You can change these default labels at Quiz settings > Default Labels > Correct Message and Incorrect Message fields.
    However, you need to be aware that changing these label defaults will have no effect whatsoever on the Success and Failure captions that are already present in your project.  Only new captions added AFTER the change will display the new text.

  • Multiple locales problem ---labels display incorrectly

    Hi, we get a problem as we try to get the internationalization support for our helpset. The Labels, for example, can not be correctly displayed if we change the language option in Internet Explorer from english to Italian. "Switch Books" would always be displayed as german language , also "index", "content"... But if we check cabo/images/cache directory, we can only find an "en" subdirectory, nothing else.
    Is it necessary to configure some files to get this support? or its automaticlly supported? by the way we have included the ohw-2.0.1.0.jar file in WEB-INF/lib

    It should be automatically supported. Some questions/comments:
    1. Do you have a german locale helpset that matches the locale used by the browser? OHW will only change the UI if it can find a matching helpset. This is to ensure the helpset and UI are in the same language.
    2. Second, you can force OHW to use a particular locale (with the condition above) by adding locale=en_US (or some other IANA code) as another request paramter. You can try this to make sure your browser settings were not incorrect the last time you tried.

  • Address Book label printing incorrect

    I am getting spouse & child details printing on some address labels in one group and on all labels in another group. These fields are not supposed to be there at all.
    '(Title, first name, surname) and (spouse/child fields)'
    What can be done to correct this?
    I'm using Avery A4 J8157 stock.

    Hi All, it's Christmas time again and I'm having the same problem - random family additions to the contact name, and it didn't happen last year. My ugly work-around is to invoke the Maiden Name field and cut and paste all the family contacts into there. At least the names don't get forgotten and it sorts out the label problem.
    Like others, the fact that Apple doesn't have the decency to acknowledge a problem so we all know where we are, makes me seethe. Who are we anyway? Just a bunch of idiot customers? I'll send an email to Steve Jobs, but the chances of a reply are those of a snowball in Hades.
    eMac   Mac OS X (10.4.8)   LaCie external disk, 3 other Macs + PC on home network

  • Bridge CS3 -- Incorrect label text string appears

    I've successfully changed the text string for the labels on four of the five "color" labels by choosing Preferences/Labels.  The 5th label (red/6) shows the correct text I would like to use in the preferences window.  But when I when I right click on a photo and point to label, the incorrect text string appears as a choice, one that does not show up in the preferences/label window.  Same incorrect text string appears when I choose label in the Bridge task bar at the top of the screen.  And, if I do choose the incorrect text stringed label by right clicking or choose label, hoping that it will remember the correct text string appearing in preferences, the incorrect text string is used and appears to the left of the bridge window under label, when I am viewing in the default view mode.  HELP!  Thanks.

    The first thing to try is trashing your Bridge preferences by holding down the Option key as you launch Bridge.

  • Label Script

    This script is for Adobe Indesign CS5 Windows.
    I´m trying change this script to acept this setup:
    Dispensing this dialog box and apply just if there is some selected image frame. (I think if there is no selected object, this will apply it to all image frame in page so I don´t wanna this couse I will use a shortcut to this script and accidents can occur)
    Sorry for long script.
    //LabelGraphics.jsx (Modified)
    //An InDesign CS3 JavaScript
    @@@BUILDINFO@@@ "LabelGraphics.jsx" 1.1.0 6-June-2008
    //Adds labels to the graphics in the active document.
    /* This sample script has been modified. The modications are listed here: option added to create a label from clipboard data,
      dropdown menu added to apply a swatch to the caption frame. This script can now apply lables to just the selected graphics
      if you have one or more images selected. Otherwise it will apply the lables to all graphics in the document. The hieght of the
      caption frame is determined by the amount of text, and paragraph style applied. the width of the caption frame is
      determined by the width of the graphic it is under. Setting the caption height in the dialog box has been removed, as it is no
      longer needed.
    main();
    //=============================================================\\
    function main(){
      if(app.documents.length != 0){
      if(app.documents.item(0).allGraphics.length != 0){
      myDisplayDialog();
      else{
      alert("Document contains no graphics.");
      else{
      alert("Please open a document and try again.");
    //=============================================================\\
    function myDisplayDialog(){
      var myLabelWidth = 100;
      var myStyleNames = myGetParagraphStyleNames();
      var mySwatchNames = myGetSwatchNames();
      var myDialog = app.dialogs.add({name:"LabelGraphics"});
      with(myDialog.dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author","Paste from clipboard"], selectedIndex:4});
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0});
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      //Swatch to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Apply swatch", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var mySwatchDropdown = dropdowns.add({stringList:mySwatchNames, selectedIndex:0});
    //=============================================================\\
      var myResult = myDialog.show();
      if(myResult == true){
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = 24; // A generic label height that will be adjusted later
      myPasteFailure = false;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var mySwatch = mySwatchNames[mySwatchDropdown.selectedIndex];
      myDialog.destroy();
      var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
      var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      try{
      myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch);
      catch(e){
      alert("Unable to add lables. " + e);
      try{
      resizeOverset() ;
      catch(e){
      alert("Unable to correct overset text. " + e);
      if (myPasteFailure == true){
      alert("Unable to paste from clipboard.");
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
      else{
      myDialog.destroy();
    //=============================================================\\
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, mySwatchName){
      var myDocument = app.documents.item(0);
      myStoriesArray = new Array();
      if (app.selection.length == 0) // If nothing is selected apply caption to all graphics in the document
      var myConfirmation = confirm("Add captions to all images in the document?", false, "LabelGraphics.jsx" );
      if (myConfirmation == true)
      var myGraphics = myDocument.allGraphics;
      else
      { // If graphics are selected, just add captions to the selected items, as long as they are rectangles(image frames)
      var myConfirmation = true;
      var mySelections = app.selection;
      myGraphics = new Array();
      for(i = 0; i < mySelections.length; i++){
      if(mySelections[i] == "[object Rectangle]"){   //Check to make sure selection only includes rectangles
      myGraphics.push(mySelections[i].allGraphics[0]);
      else{
      //alert("Objects other than graphics were selected!");
      //Nothing happens if you don't select at least one graphic
      myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      mySwatch = myDocument.swatches.item(mySwatchName);
      if (myConfirmation == true){
      for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
      try{
      myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray);
      catch(e){};
    //=============================================================\\
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray){
      var myLabel;
      var myLink = myGraphic.itemLink;
      var myPasteFromClipboard = false;
      //Create the label layer if it does not already exist.
      var myLabelLayer = myDocument.layers.item("labels");
      try{
      myLabelLayer.name;
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:"labels"});
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      catch(myError){
      myLabel = "No description available.";
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      catch(myError){
      myLabel = "No author available.";
      break;
      //Paste from the clipboard
      case 4:
      try{
      myPasteFromClipboard = true;
      catch(myError){
      myLabel = "No clipboard data available.";
      break;
      var myFrame = myGraphic.parent;
      myX1 = myFrame.geometricBounds[1];
      myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      myX2 = myFrame.geometricBounds[3];
      myY2 = myY1 + myLabelHeight;
      if (myPasteFromClipboard ==true)
      try{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2]});
      myTextFrame.insertionPoints.item(0).select();
      app.paste();
      catch(e){
      myTextFrame.remove();
      myPasteFailure = true;
      else{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;
      myTextFrame.fillColor = mySwatch;
      myFrameParentStory = myTextFrame.parentStory;
      myStoriesArray.push(myFrameParentStory);
    //=============================================================\\
    function myGetParagraphStyleNames(){
      var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
      return myStyleNames;
    function myGetSwatchNames(){
      var mySwatchNames = app.documents.item(0).swatches.everyItem().name;
      return mySwatchNames;
    function resizeOverset() {
                for (var j = myStoriesArray.length - 1; j >= 0; j--) {
                        myLastFrame = myStoriesArray[j].texts[0].parentTextFrames[myStoriesArray[j].texts[0].parentTextFrames.l ength - 1];
      myNewY2 = myLastFrame.geometricBounds[3]; //get the width of the text frame before doing fit()
      myLastFrame.fit(FitOptions.FRAME_TO_CONTENT);
      myNewY1 = myLastFrame.geometricBounds[1];
      myNewX1 = myLastFrame.geometricBounds[2];
      myNewX2 = myLastFrame.geometricBounds[0];
      myLastFrame.geometricBounds = [myNewX1, myNewY1, myNewX2, myNewY2]; // reset the width to before fit() was ran

    Hi,
    Function runWithoutDialog() added - permanent sets inside:
    //LabelGraphics.jsx (Modified)
    //An InDesign CS5 JavaScript
    @@@BUILDINFO@@@ "LabelGraphics.jsx" 1-Dec-2014
    //Adds labels to the graphics in the active document.
    /* User interaction switched off
      see settings inside runWithoutDialog() function
    main();
    //=============================================================\\
    function main(){
      myStoriesArray = new Array();
      if(app.documents.length != 0){
      if(app.selection[0].allGraphics.length != 0){
      runWithoutDialog(); // myDisplayDialog();
      else{
      alert("Select some frame with graphic");
      else{
      alert("Please open a document and try again.");
    //=============================================================\\
    function runWithoutDialog(){
      var myLabelWidth = 100;
      var myStyleNames = myGetParagraphStyleNames();
      var mySwatchNames = myGetSwatchNames();
      var myLabelType = 4; // paste from clipboard
      var myLabelHeight = 24; // A generic label height that will be adjusted later
      myPasteFailure = false;
      var myLabelOffset = 0;
      var myLabelStyle = myStyleNames[0];
      var mySwatch = mySwatchNames[0];
      var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
      var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      try{
      myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch);
      catch(e){
      alert("Unable to add lables. " + e);
      try{
      resizeOverset() ;
      catch(e){
      alert("Unable to correct overset text. " + e);
      if (myPasteFailure == true){
      alert("Unable to paste from clipboard.");
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
    //=============================================================\\
    function myDisplayDialog(){
      var myLabelWidth = 100;
      var myStyleNames = myGetParagraphStyleNames();
      var mySwatchNames = myGetSwatchNames();
      var myDialog = app.dialogs.add({name:"LabelGraphics"});
      with(myDialog.dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author","Paste from clipboard"], selectedIndex:4});
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0});
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      //Swatch to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Apply swatch", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var mySwatchDropdown = dropdowns.add({stringList:mySwatchNames, selectedIndex:0});
      //=============================================================\\
      var myResult = myDialog.show();
      if(myResult == true){
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = 24; // A generic label height that will be adjusted later
      myPasteFailure = false;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var mySwatch = mySwatchNames[mySwatchDropdown.selectedIndex];
      myDialog.destroy();
      var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
      var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      try{
      myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch);
      catch(e){
      alert("Unable to add lables. " + e);
      try{
      resizeOverset() ;
      catch(e){
      alert("Unable to correct overset text. " + e);
      if (myPasteFailure == true){
      alert("Unable to paste from clipboard.");
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
      else{
      myDialog.destroy();
    //=============================================================\\
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, mySwatchName){
      var myDocument = app.documents.item(0);
      if (app.selection.length == 0) // If nothing is selected apply caption to all graphics in the document
      var myConfirmation = false; // confirm("Add captions to all images in the document?", false, "LabelGraphics.jsx" );
      if (myConfirmation == true)
      var myGraphics = myDocument.allGraphics;
      else
      { // If graphics are selected, just add captions to the selected items, as long as they are rectangles(image frames)
      var myConfirmation = true;
      var mySelections = app.selection;
      myGraphics = new Array();
      for(i = 0; i < mySelections.length; i++){
      if(mySelections[i] == "[object Rectangle]"){  //Check to make sure selection only includes rectangles
      myGraphics.push(mySelections[i].allGraphics[0]);
      else{
      //alert("Objects other than graphics were selected!");
      //Nothing happens if you don't select at least one graphic
      myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      mySwatch = myDocument.swatches.item(mySwatchName);
      if (myConfirmation == true){
      for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
      try{
      myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray);
      catch(e){};
    //=============================================================\\
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray){
      var myLabel;
      var myLink = myGraphic.itemLink;
      var myPasteFromClipboard = false;
      //Create the label layer if it does not already exist.
      var myLabelLayer = myDocument.layers.item("labels");
      try{
      myLabelLayer.name;
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:"labels"});
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      catch(myError){
      myLabel = "No description available.";
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      catch(myError){
      myLabel = "No author available.";
      break;
      //Paste from the clipboard
      case 4:
      try{
      myPasteFromClipboard = true;
      catch(myError){
      myLabel = "No clipboard data available.";
      break;
      var myFrame = myGraphic.parent;
      myX1 = myFrame.geometricBounds[1];
      myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      myX2 = myFrame.geometricBounds[3];
      myY2 = myY1 + myLabelHeight;
      if (myPasteFromClipboard ==true)
      try{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2]});
      myTextFrame.insertionPoints.item(0).select();
      app.paste();
      catch(e){
      myTextFrame.remove();
      myPasteFailure = true;
      else{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;
      myTextFrame.fillColor = mySwatch;
      myFrameParentStory = myTextFrame.parentStory;
      myStoriesArray.push(myFrameParentStory);
    //=============================================================\\
    function myGetParagraphStyleNames(){
      var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
      return myStyleNames;
    function myGetSwatchNames(){
      var mySwatchNames = app.documents.item(0).swatches.everyItem().name;
      return mySwatchNames;
    function resizeOverset() {
      for (var j = myStoriesArray.length - 1; j >= 0; j--) {
      myLastFrame = myStoriesArray[j].texts[0].parentTextFrames[myStoriesArray[j].texts[0].parentTextFrames.length - 1];
      myNewY2 = myLastFrame.geometricBounds[3]; //get the width of the text frame before doing fit()
      myLastFrame.fit(FitOptions.FRAME_TO_CONTENT);
      myNewY1 = myLastFrame.geometricBounds[1];
      myNewX1 = myLastFrame.geometricBounds[2];
      myNewX2 = myLastFrame.geometricBounds[0];
      myLastFrame.geometricBounds = [myNewX1, myNewY1, myNewX2, myNewY2]; // reset the width to before fit() was ran

  • Getting Correct and Incorrect to show on my GUI

    What am i missing to allow correct and incorrect to show on my GUI.
    package anaquiz;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AnAQuiz extends JPanel {
        private JComboBox choice;
        private JLabel label;
        private JTextField text;
        Button CheckAnswer;
        Button TryAgain;
        private String Answer1 = "Wilson";
        private String Answer2 = "Ace";
        private String Answer3 = "Yes";
        private String input = " ";
        boolean Answer = false;
        JLabel testresult;
        public AnAQuiz() {
            choice = new JComboBox();
            label = new JLabel();
            label.setBackground(Color.blue);
            choice.addItem("Tennis Question #1");
            choice.addItem("Tennis Question #2");
            choice.addItem("Tennis Question #3");
            text = new JTextField(42); //step 4
            Listener listen = new Listener();
            choice.addActionListener(listen);
            add(choice);
            add(label);
            add(text);
        private class Listener implements ActionListener {
            public void actionPerformed(ActionEvent event ) {
            int c = choice.getSelectedIndex();
                switch (c) {
                case 0:
                    label.setText("Whats the famous tennis brand that begins with 'W'?");
                    if (input.equals(Answer1))testresult = new JLabel("Correct!"); //Having difficulty getting the correct and the incorrect to show as a label
                     else testresult = new JLabel("Incorrect!");
                     break;
                 case 1:
                    label.setText("What do you call when someone misses a serve?");
                    break;
                 case 2:
                    label.setText("Should you shake hands after a match?");
                    break;
        public static void main(String[] args)
            JFrame frame = new JFrame("Quiz");
             frame.getContentPane().add(new AnAQuiz());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.show();

    Basically adding in the code tjacobs01 demo'd for you and a little extra.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AnAQuiz extends JPanel {
        private int chosen;
        private JComboBox choice;
        private JLabel label;
        private JTextField text;
        Button CheckAnswer;
        Button TryAgain;
        private String Answer1 = "Wilson";
        private String Answer2 = "Ace";
        private String Answer3 = "Yes";
        private String input = " ";
        boolean Answer = false;
        JLabel testresult = new JLabel("");
        public AnAQuiz() {
            choice = new JComboBox();
            label = new JLabel();
            label.setBackground(Color.blue);
            choice.addItem("Tennis Question #1");
            choice.addItem("Tennis Question #2");
            choice.addItem("Tennis Question #3");
            text = new JTextField(42); //step 4
            Listener listen = new Listener();
            choice.addActionListener(listen);
            setLayout(new BoxLayout(this, 0));
            add(choice);
            add(label);
            add(text);
              text.addKeyListener(new KeyAdapter() {
              public void keyPressed(KeyEvent ke) {
                if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
                  input = text.getText();
                  if ( chosen == 0  &&  input.equals(Answer1) )
                    label.setText("Correct");
                  else if ( chosen == 1  &&  input.equals(Answer2) )
                    label.setText("Correct");
                  else if ( chosen == 2  &&  input.equals(Answer3) )
                    label.setText("Correct");
                  else
                    label.setText("Incorrect");
            add(testresult);
            testresult.setVisible(false);
        private class Listener implements ActionListener {
            public void actionPerformed(ActionEvent event ) {
            chosen = choice.getSelectedIndex();
            testresult.setVisible(true);
                switch (chosen) {
                case 0:
                    label.setText("Whats the famous tennis brand that begins with 'W'?");
                    break;
                 case 1:
                    label.setText("What do you call when someone misses a serve?");
                    break;
                 case 2:
                    label.setText("Should you shake hands after a match?");
                    break;
                 default:
                    break;
                text.requestFocus();
        public static void main(String[] args)
            JFrame frame = new JFrame("Quiz");
            frame.getContentPane().add(new AnAQuiz());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
    }

  • Insert String array as label content in datagrid row through radio button C# wpf?

    I have written some code for inserting label at runtime having its content set to a string array and then insert that label into a datagrid row . All of this will initiate when certain radiobuttons are checked. code is working perfectly fine. But i need
    to improve this code as i am learning C#, wpf and datagrid. I know there can be a certain way to improve this code. 
    This code will be a nightmare when there are 50 radiobuttons. 
    can it be improve and how it can be? if u can explain that will be very kind of you  
    Xaml Code:
    <Grid>
    <RadioButton x:Name="rb_1" Content="RadioButton" HorizontalAlignment="Left" Margin="351,85,0,0" VerticalAlignment="Top" GroupName="1" />
    <RadioButton x:Name="rb_2" Content="RadioButton" HorizontalAlignment="Left" Margin="351,105,0,0" VerticalAlignment="Top" GroupName="1"/>
    <RadioButton x:Name="rb_3" Content="RadioButton" HorizontalAlignment="Left" Margin="351,120,0,0" VerticalAlignment="Top" GroupName="1" />
    <RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="351,159,0,0" VerticalAlignment="Top" GroupName="2" />
    <RadioButton x:Name="rb_4" Content="RadioButton" HorizontalAlignment="Left" Margin="351,179,0,0" VerticalAlignment="Top" GroupName="2"/>
    <RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="351,199,0,0" VerticalAlignment="Top" GroupName="2" />
    <Button Content="Button" HorizontalAlignment="Left" Margin="713,60,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_2"/>
    <DataGrid x:Name="datagrid_" HorizontalAlignment="Left" Margin="549,85,0,0" VerticalAlignment="Top" Height="253" Width="399" />
    <RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="351,226,0,0" VerticalAlignment="Top" GroupName="3" />
    <RadioButton x:Name="rb_6" Content="RadioButton" HorizontalAlignment="Left" Margin="351,246,0,0" VerticalAlignment="Top" GroupName="3"/>
    <RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="351,266,0,0" VerticalAlignment="Top" GroupName="3" />
    <RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="351,298,0,0" VerticalAlignment="Top" GroupName="4" />
    <RadioButton x:Name="rb_8" Content="RadioButton" HorizontalAlignment="Left" Margin="351,318,0,0" VerticalAlignment="Top" GroupName="4"/>
    <RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="351,338,0,0" VerticalAlignment="Top" GroupName="4" />
    </Grid>
    Code Behind:
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    DataTable dt;
    DataRow dr;
    string[] str = new string[4];
    int location = 0;
    int count = 0;
    private void Window_Loaded(object sender, RoutedEventArgs e)
    dt = new DataTable("emp");
    DataColumn dc1 = new DataColumn("Factors", typeof(string));
    DataColumn dc2 = new DataColumn("Non_Compliant", typeof(string));
    dt.Columns.Add(dc1);
    dt.Columns.Add(dc2);
    datagrid_.ItemsSource = dt.DefaultView;
    private void Button_Click_2(object sender, RoutedEventArgs e)
    if (count >= 1)
    datagrid_.ItemsSource = dt.DefaultView;
    dt.Clear();
    str[0] = "Load Path1";
    str[1] = "Load Path2";
    str[2] = "Load Path3";
    str[3] = "Load Path4";
    int j = 0;
    if (rb_2.IsChecked == true)
    j = 0;
    int k = 0;
    dr = dt.NewRow();
    Label label = new Label();
    label.Height = 28;
    label.Width = 100;
    label.HorizontalAlignment = HorizontalAlignment.Center;
    label.VerticalAlignment = VerticalAlignment.Center;
    label.Content = str[j];
    dr[k] = label.Content;
    dt.Rows.Add(dr);
    datagrid_.ItemsSource = dt.DefaultView;
    location += 34;
    if (rb_4.IsChecked == true)
    j = 1;
    int k = 0;
    dr = dt.NewRow();
    Label label = new Label();
    label.Height = 28;
    label.Width = 100;
    label.HorizontalAlignment = HorizontalAlignment.Center;
    label.VerticalAlignment = VerticalAlignment.Center;
    label.Content = str[j];
    dr[k] = label.Content;
    dt.Rows.Add(dr);
    datagrid_.ItemsSource = dt.DefaultView;
    location += 34;
    if (rb_6.IsChecked == true)
    j = 2;
    int k = 0;
    dr = dt.NewRow();
    Label label = new Label();
    label.Height = 28;
    label.Width = 100;
    label.HorizontalAlignment = HorizontalAlignment.Center;
    label.VerticalAlignment = VerticalAlignment.Center;
    label.Content = str[j];
    dr[k] = label.Content;
    dt.Rows.Add(dr);
    datagrid_.ItemsSource = dt.DefaultView;
    location += 34;
    if (rb_8.IsChecked == true)
    j = 3;
    int k = 0;
    dr = dt.NewRow();
    Label label = new Label();
    label.Height = 28;
    label.Width = 100;
    label.HorizontalAlignment = HorizontalAlignment.Center;
    label.VerticalAlignment = VerticalAlignment.Center;
    label.Content = str[j];
    dr[k] = label.Content;
    dt.Rows.Add(dr);
    datagrid_.ItemsSource = dt.DefaultView;
    location += 34;
    count++;

    @Usamakhan1990,
    Use usercontrol with label and checkbox is reasonable for a datagrid control if you don't want to have too much code for those radio buttons. So I agree with andy here with that usercontrol.
    So is it required that your radiobutton should be outside the datagrid?
    Anyway, I think you already know that you can bind data to columns yourself. So please check the following thread:
    http://stackoverflow.com/questions/22922533/how-do-i-automagically-bind-a-string-array-to-a-wpf-datagrid
    <DataGrid Name="_dataGrid" Grid.Row="0" AutoGenerateColumns="False">
    <DataGrid.Columns>
    <DataGridTextColumn Header="Column 1" Binding="{Binding [0]}"/>
    <DataGridTextColumn Header="Column 2" Binding="{Binding [1]}"/>
    </DataGrid.Columns>
    </DataGrid>
    Or define the columns from code, in case you have dynamic number of columns, for example :
    string[][] array = fs.CSVToStringArray();
    for (int i = 0; i < array[0].Length; i++)
    var col = new DataGridTextColumn();
    col.Header = "Column " + i;
    col.Binding = new Binding(string.Format("[{0}]", i));
    _dataGrid.Columns.Add(col);
    this.ExternalData._dataGrid.ItemsSource = array;
    And for Radio button part, please see here:
    http://stackoverflow.com/questions/397556/how-to-bind-radiobuttons-to-an-enum
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Printing address labels

    Hello,
    I'm trying to print labels on continuous paper. So I defined the paper size and ImageableArea to the size of my labels, treating each label as a complete page, which is printed by printerJob.print(). So far so good, but after each label (each print()) a form feed is output, moving the paper ahead for the remaining A4 length.
    Is there a way to suppress this form feed? If not, how would you proceed?

    After placing now all the labels on one single long page and protocolling the output in the Printable.print(...) method, all looks fine. Nevertheless the printer stops printing after about 30 cm without any error message.
    Also, after loading the label paper, generally the paper posiiton needs to be adjusted, so that the addresses are printed with nice top and bottom margins. To achieve this, I put the first address in a loop which is quit when the user acknowledges that everything is ok.
    In my first approach of setting the page height to the label height this is no problem. But when the print job immediately comprises all the labels, this is not possible any more. So suppressing the form feed at the end of a page would still be my favourite, but seems to be impossible.

  • Flex mobile 4.5 - Multiline Labels?

    Hey, not very sure how to make multiline labels. Is this easily done? Tried to give standard labels height but that doesnt seem to work. In most other languages theres usually a multiline=true kinda dealy but im not sure how to do it in flex. Thanks!

    Look at the answers here: http://stackoverflow.com/questions/6478979/multiline-labels-in-flex-4-5-mobile-apps
    My answer:
    Instead of a label, can you use a StyleableTextField?  If so, just set the wordWrap property to true.

  • Problems with Value Labels in Stacked Bar Chart

    Post Author: RGR
    CA Forum: Charts and Graphs
    When choosing a stacked bar chart to display the contribution of 2 values to the overall total, the graph plots correctly, but the value labels are incorrect.  Instead of labeling the values for A & B, the graph is appropriately labeled for A ,but the label for B is the total for A+B.  It should be just "B".
    Has anyone else experienced this problem or has a solution.  I am using CR 2008
    TX

    Post Author: Joy Hampson
    CA Forum: Charts and Graphs
    I have this issue a lot with CR XI.  As I have never used CR 2008, I am not sure of the commands.  But in CR XI, right click on the graph and select Chart Options.  On the Data Labels tab, at the bottom there are two options: Cumulative and Absolute.  It defaults to Cumulative, so change to Absolute.  That always works for me.

  • Item Info (length) incorrect

    Something I don't understand: I have a series of MPGs and QT files on my desktop, displayed with Item Info next to their icons. But the length label is incorrect on all of them. For example, an MPG file 8 mins and 40 secs in length is labeled as being 1 HOUR, 17 mins and 3 secs long.
    Why is that?

    QuickTime has some issues with .mpg files. If the original file was edited (say nine minutes of a ten minute file was removed) it may report the files total time as still being 10 minutes.
    The time stamps in the video are "broken". This can also interfere with video playback.
    MPEG Streamclip can fix broken time stamps. It's free.

  • Dynamically rezizing a Label

    Hi, I have a Label inside a VBox.
    My VBox has a width of 100% so when the widow is resized the
    VBox scales to the size of the window.
    I want the Label inside the VBox to scale relevant to the
    size of the VBox containing it, so for example if the VBox is
    scaled to a very small size and even height of "0" the label will
    not be visible.
    is there anyway I can do this in ActionScript?
    I have tried so far to add a resize listener to the vbox
    performing math calculations on the label height and font size,
    which worked to a certain degree, however was jerky and the
    performance was v-slow when the calculation was performed on many
    VBox containing Labels simultaneously.
    I am after an efficient and reliable solution to my problem.
    Any advice is much appreciated,
    Thanks,
    Jon.

    Hi matt - that is exactly what I did.
    I have a loop that can loop up and over 100 items - for each
    of these items I add a VBox and a label as a chold of the VBox.
    I set both the font size and label height to bindable
    variables that are calculated when the VBox is re sized. This sort
    of worked but like I say is jerky and when there are a lot of items
    the performance is not great.
    Kind Regards,
    Jon.

  • Inserting image to a html file

    Hey guys, its been awhile since i worked with codes and i now need to ad an image to my home page where i left a space just for it. I know the image code but it doesn´t seem to be working i think i am placing it in the wrong place. Can someone help me out please ? If needs to i can send the html file (home.html) and the screenshot of my page.
    Thank you guys

    This is the code from your posted link.  I copied View > Source from FF and pasted into NoteTab....  Removed white spaces and copy Ctrl+C & pasted Ctrl+V here using >> Syntax highlighting > Plain.
    Unfortunately, this is only the bloated HTML.  It doesn't include styles from your 9 external CSS files!
    So where are you trying to insert an image???
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html><head>
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    <title>BearGround.com</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Cache-Control" content="no-cache,post-check=0,pre-check=0,no-cache">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="Thu,01Dec199416:00:00GMT">
    <script type="text/javascript"> function stopError() { return true; }; window.onError = stopError; window.status=Date();</script>
    <script type="text/javascript" src="./_server/lib.js"></script>
    <link href="./_themes/main/the_bear/img/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="./_themes/main/the_bear/css/screen.css" type="text/css" media="screen">
    <link rel="stylesheet" media="all" type="text/css" href="./_themes/main/the_bear/css/bg-menu.css">
    <link rel="stylesheet" href="./_themes/main/the_bear/css/inner.css" type="text/css" media="screen">
    <link rel="stylesheet" href="./_themes/main/the_bear/css/bg.css" type="text/css" media="screen">
    <!--[if IE]><link rel="stylesheet" href="./_themes/main/the_bear/css/ie.css" type="text/css"><![endif]-->
    <!--[if lt IE 7]><script type="text/javascript" src="./_themes/main/the_bear/js/bgsleight.js"></script><![endif]-->
    <link rel="stylesheet" href="./_themes/main/the_bear/css/210107.css" type="text/css" media="screen">
    <link rel="stylesheet" href="./_server/games/game.css" type="text/css">
    <link rel="stylesheet" href="./_server/video/video.css" type="text/css">
    <link rel="stylesheet" href="./_server/audiochat/audio.css" type="text/css">
    <link rel="stylesheet" href="./_server/im_new/im.css" type="text/css">
    <script type="text/javascript">
    var xajaxRequestUri="./_server/server.php";
    var xajaxDebug=false;
    var xajaxStatusMessages=false;
    var xajaxWaitCursor=false;
    var xajaxDefinedGet=0;
    var xajaxDefinedPost=1;
    var xajaxLoaded=false;
    function xajax_countries(){return xajax.call("countries", arguments, 1);}
    function xajax_states(){return xajax.call("states", arguments, 1);}
    function xajax_cities(){return xajax.call("cities", arguments, 1);}
    function xajax_update(){return xajax.call("update", arguments, 1);}
    function xajax_im(){return xajax.call("im", arguments, 1);}
    function xajax_im_open(){return xajax.call("im_open", arguments, 1);}
    function xajax_im_sent(){return xajax.call("im_sent", arguments, 1);}
    function xajax_im_close(){return xajax.call("im_close", arguments, 1);}
    function xajax_im_update(){return xajax.call("im_update", arguments, 1);}
    function xajax_game_invite(){return xajax.call("game_invite", arguments, 1);}
    function xajax_game_reject(){return xajax.call("game_reject", arguments, 1);}
    function xajax_game_go(){return xajax.call("game_go", arguments, 1);}
    function xajax_video_invite(){return xajax.call("video_invite", arguments, 1);}
    function xajax_video_reject(){return xajax.call("video_reject", arguments, 1);}
    function xajax_video_go(){return xajax.call("video_go", arguments, 1);}
    function xajax_audio_invite(){return xajax.call("audio_invite", arguments, 1);}
    function xajax_audio_reject(){return xajax.call("audio_reject", arguments, 1);}
    function xajax_audio_go(){return xajax.call("audio_go", arguments, 1);}
    function xajax_saveAlbumTitle(){return xajax.call("saveAlbumTitle", arguments, 1);}
    function xajax_saveAlbumDesc(){return xajax.call("saveAlbumDesc", arguments, 1);}
    function xajax_saveImageTitle(){return xajax.call("saveImageTitle", arguments, 1);}
    function xajax_saveImageDesc(){return xajax.call("saveImageDesc", arguments, 1);}
    </script>
    <script type="text/javascript" src="./_server/xajax_js/xajax.js"></script>
    <script type="text/javascript">
    window.setTimeout(function () { if (!xajaxLoaded) { alert('Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect?\nURL: ./_server/xajax_js/xajax.js'); } }, 6000);
    </script>
    <script type="text/javascript" src="./_server/client.js"></script>
    <script type="text/javascript" src="./_server/im_new/sounds/sm.js"></script>
    <SCRIPT TYPE="text/javascript">
    <!--
    function popupform(myform, windowname)
    if (! window.focus)return true;
    window.open('', windowname, 'width=367,height=600,scrollbars=no,resizable=yes');
    myform.target=windowname;
    return true;
    //-->
    </SCRIPT>
    <!--[if lte IE 8]>
    <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
    <![endif]-->
    </head>
    <body>
    <div id="wrapper">
    <div id="header">
    <div id="flashheader">
    </div>
    <ul>
    <li><a href="./news.php?view=4"><img src="./_themes/main/the_bear/img/menu-01.gif" height="7" alt="Site Tour"></a></li>
    <li><a href="./news.php?cat=2"><img src="./_themes/main/the_bear/img/menu-02.gif" height="7" alt=""></a></li>
    <li><a href="./news.php?"><img src="./_themes/main/the_bear/img/menu-03.gif" height="7" alt="Site Info"></a></li>
    </ul>
    </div>
    <iframe id="v3chat2" name="v3chat2" style="width:0px; height:0px; border: 0px" src="v3messenger/run.php?mid=0"></iframe>
    <div id="wrapper">
    <!--     <div id="header">
    <!--<script type="text/javascript"><!--
    document.write('<s'+'cript type="text/javascript" src="http://www.ads.bearground.com/show.php?z=16&j=1&code='+new Date().getTime()+'"></s'+'cript>');
    // --></script>
    <!--<noscript>
    <iframe src="http://www.ads.bearground.com/show.php?z=16" width="940" height="144" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>
    </noscript>-->
    <!--</div>-->
    <div id="main">
    <div id="main-in">
    <div id="main-out" class="clearfix">
    <div class="welcome">
    <table width="888px"><tr>
    <td align="left" style=" width:296px;padding-left:20px;">
    Welcome to <strong>BearGround.com</strong>
    </td>
    <td  align="center" style="width:296px;">
    <a href="join.php?set_language=spain" target="_top"><img src="img/SPAN0002_S.jpg" alt="Espa&ntilde;ol" width="30" height="20"></a>
    <a href="join.php?set_language=english" target="_top"><img src="img/UNKG0002_S.jpg" alt="English" width="30" height="20"></a>
    <a href="join.php?set_language=french" target="_top"><img src="img/FRAN0004_S.jpg" alt="Fran&ccedil;ais" width="30" height="20"></a>
    </td>
    <td align="right" style="width:296px;padding-right:20px;" id="menu_top_right">
    <a href="./index.php">Join Now!</a>
     | 
    <a href="./index.php">Login</a>
    </td>
    </tr></table>
    </div>
    <div class="menu">
    <ul>
    <li><a href="./home.php">HOME</a></li>
    <li><a href="./users_online.php">ONLINE NOW!</a></li>
    <li><a href="./search.php">SEARCH</a></li>
    <li><a href="./gallery_index.php">PHOTO GALLERY</a></li>
    <li><a href="./videogallery_video_view.php">VIDEO GALLERY</a></li>
    <li><a href="./my_friends.php">FRIENDS</a></li>
    <li><a href="./mail.php">MAIL</a></li>
    <li><a href="./flashchat.php">CHAT ROOM</a></li>
    <li><a href="./blogs.php">BLOG</a></li>
    <li><a href="./forum.php">FORUM</a></li>
    <li><a href="./groups.php">GROUPS</a></li>
    <li><a href="./events_index.php">EVENTS</a></li>
    </ul>
    </div>
    <div class="personal-st">
    <ul>
    <li><img src="./_themes/main/the_bear/img/camera.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./profile_photo.php" style="font-weight: normal">My Photos</a></li>
    <li><img src="./_themes/main/the_bear/img/appearance.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./gallery_admin.php" style="font-weight: normal">Upload to Gallery</a></li>
    <li><img src="./_themes/main/the_bear/img/my_clips.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./profile_video_edit.php" style="font-weight: normal">My Clips</a></li>
    <li><img src="./_themes/main/the_bear/img/multimedia_1.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./profile_audio_edit.php" style="font-weight: normal">My Music</a></li>
    <li><img src="./_themes/main/the_bear/img/my_vids.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./videogallery_myvideo_view.php" style="font-weight: normal">My Vids</a></li>
    <li><img src="./_themes/main/the_bear/img/txt2.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./profile_blog.php" style="font-weight: normal">My Blog</a></li>
    <li><img src="./_themes/main/the_bear/img/access.png" style="behavior: url('./_server/design/pngbehavior.htc');" align="absmiddle" alt=""> <a href="./profile.php" style="font-weight: normal">Account</a></li>
    </ul>
    </div>
    <div id="main2">
    <div id="main-in2">
    <div id="main-out2">
    <div class="userinfo-c-wide">
    <div class="userinfo smallphoto clearfix">
    <style type="text/css">
    #join label{height: 18px; line-height: 18px; padding-right: 4px;}
    #join input{font-size: 13px; border: 1px solid #757B05; width: 130px;}
    #join #from, #join #iam{width: 180px; margin-top: 3px;}
    #join #month{width: 92px;}
    #join #month, #join #day, #join #year{margin-top: 3px;}
    </style>
    <script language="JavaScript" type="text/javascript">
    function onValidateJoinForm() {
    var form = document.forms['JoinForm'];
    if (!(validateRequiredField(form['join_handle'], 'Username'))) {
    return false;
    if (!(validateMinLength(form['join_handle'], 'Username','4'))) {
    return false;
    if (!(validateMaxLength(form['join_handle'], 'Username','20'))) {
    return false;
    if (!(validateAlphaNumeric(form['join_handle'], 'Username'))) {
    return false;
    if (!(validateRequiredField(form['join_handle'], 'Username'))) {
    return false;
    if (!(validateMinLength(form['join_handle'], 'Username','4'))) {
    return false;
    if (!(validateMaxLength(form['join_handle'], 'Username','20'))) {
    return false;
    if (!(validateAlphaNumeric(form['join_handle'], 'Username'))) {
    return false;
    if (!(validateRequiredField(form['join_password'], 'Password'))) {
    return false;
    if (!(validateMinLength(form['join_password'], 'Password','6'))) {
    return false;
    if (!(validateMaxLength(form['join_password'], 'Password','15'))) {
    return false;
    if (!(validateAlphaNumeric(form['join_password'], 'Password'))) {
    return false;
    if (!(validateRequiredField(form['join_password'], 'Password'))) {
    return false;
    if (!(validateMinLength(form['join_password'], 'Password','6'))) {
    return false;
    if (!(validateMaxLength(form['join_password'], 'Password','15'))) {
    return false;
    if (!(validateAlphaNumeric(form['join_password'], 'Password'))) {
    return false;
    if (!(validateNotTwoFields(form['join_password'],'Password',form['join_handle'],'Username'))) {
    return false;
    if (!(validateTwoFields(form['verify_password'],'Verify Password',form['join_password'],'Password'))) {
    return false;
    if (!(validateRequiredField(form['email'], 'Email Address'))) {
    return false;
    if (!(validateMaxLength(form['email'], 'Email Address','100'))) {
    return false;
    if (!(validateEmailField(form['email'], 'Email Address'))) {
    return false;
    if (!(validateRequiredField(form['verify_email'], 'Verify Email'))) {
    return false;
    if (!(validateMaxLength(form['verify_email'], 'Verify Email','100'))) {
    return false;
    if (!(validateEmailField(form['verify_email'], 'Verify Email'))) {
    return false;
    if (!(validateTwoFields(form['verify_email'],'Verify Email',form['email'],'Email Address'))) {
    return false;
    if (!(validateRequiredSelect(form['country'],'Country','-1'))) {
    return false;
    if (!(validateRequiredField(form['country'], 'Country', '-1'))) {
    return false;
    if (!(validateRequiredField(form['month'], 'Month'))) {
    return false;
    if (!(validateRequiredField(form['day'], 'Day'))) {
    return false;
    if (!(validateRequiredField(form['year'], 'Year'))) {
    return false;
    if (!(validateRequiredCheckbox(form['privacy_policy'],'','If you have read and agreed to the Terms and Conditions and the Privacy Policy, then please select the checkbox.'))) {
    return false;
    return true;
    function validateJoinForm() {
    blockSubmission = true;
    if (typeof beforeJoinFormValidation != 'undefined') {
    beforeJoinFormValidation();
    var validated = onValidateJoinForm();
    if (validated && (typeof uponSuccessfulJoinFormValidation != 'undefined')) {
    validated = uponSuccessfulJoinFormValidation();
    else if (!validated && (typeof uponUnsuccessfulJoinFormValidation != 'undefined')) {
    uponUnsuccessfulJoinFormValidation();
    if (!validated) {
    return validated;
    function submitJoinForm() {
    if (validateJoinForm()) document.JoinForm.submit();
    else return false;
    </script>
    <table width="100%"><tr><td width="35%" align="right" valign="top">
    <div  class="header_big" style="padding-bottom: 10px; padding-top: 100px; text-align: right;">Login</div>
    <form method="post" action="./join.php?cmd=login" id="login-f" class="clearfix">
    <div id="join">
    Please login or register.<br><br />
    <label for="username">Username:</label><input name="user" type="text" id="login" tabindex="1" /><br />
    <label for="password">Password:</label><input name="password" type="password" tabindex="2" /><br />
    </div><br />
    <input type="submit" value="Login" class="button" style="padding-left: 5px; padding-right: 5px; cursor: pointer; cursor: hand;" />
    <p><input name="remember" type="checkbox" id="remember" class="chk" value="1" type="checkbox"> <label for="remember">Remember me</label> | <a href="./forget_password.php?">Forgot password?</a></p>
    </form>
    </td><td width="20%"> 
    </td><td width="35%" align="right" valign="top">
    <form name="JoinForm" method="post" action="./join.php" onsubmit="return validateJoinForm();">
    <div  class="header_big" style="padding-bottom: 10px; padding-top: 100px; text-align: right;">Join Now!</div>
    <div id="join">
    <br />
    <label for="username">Username:</label><input type="text" id="username" name="join_handle" value="" /><br />
    <label for="create-password">Create Password:</label><input type="password" id="create-password" name="join_password" value="" /><br />
    <label for="re-password">Re-enter Password:</label><input type="password" id="re-password" name="verify_password" value="" /><br />
    <label for="email">E-mail:</label><input type="text" id="email" name="email" value="" /><br />
    <label for="re-email">Re-enter E-mail:</label><input type="text" id="re-email" name="verify_email" value="" /><br />
    <label for="from">From:</label>
    <select name="country" id="from">
    <option value="-1" selected="selected"></option>
    <option value="1" selected="selected">United States</option>
    <option value="2">Canada</option>
    <option value="3">United Kingdom</option>
    <option value="-1"></option>
    <option value="5">Afghanistan</option>
    <option value="6">Albania</option>
    <option value="7">Algeria</option>
    <option value="8">Andorra</option>
    <option value="9">Angola</option>
    <option value="10">Anguilla</option>
    <option value="11">Antigua and Barbuda</option>
    <option value="12">Argentina</option>
    <option value="13">Armenia</option>
    <option value="14">Aruba</option>
    <option value="15">Australia</option>
    <option value="16">Austria</option>
    <option value="17">Azerbaijan</option>
    <option value="18">Bahamas</option>
    <option value="19">Bahrain</option>
    <option value="20">Bangladesh</option>
    <option value="21">Barbados</option>
    <option value="22">Belarus</option>
    <option value="23">Belgium</option>
    <option value="24">Belize</option>
    <option value="25">Benin</option>
    <option value="26">Bermuda</option>
    <option value="27">Bhutan</option>
    <option value="28">Bolivia</option>
    <option value="29">Bosnia and Herzegovina</option>
    <option value="30">Botswana</option>
    <option value="31">Brazil</option>
    <option value="32">British Virgin Islands</option>
    <option value="33">Brunei</option>
    <option value="34">Bulgaria</option>
    <option value="35">Burkina Faso</option>
    <option value="36">Burundi</option>
    <option value="37">Cambodia</option>
    <option value="38">Cameroon</option>
    <option value="2">Canada</option>
    <option value="39">Cape Verde</option>
    <option value="40">Cayman Islands</option>
    <option value="41">Central African Republic</option>
    <option value="42">Chad</option>
    <option value="43">Chile</option>
    <option value="44">China</option>
    <option value="45">Christmas Island</option>
    <option value="46">Cocos (Keeling) Islands</option>
    <option value="47">Colombia</option>
    <option value="48">Comoros</option>
    <option value="49">Congo</option>
    <option value="50">Congo, Democratic Republic</option>
    <option value="51">Cook Islands</option>
    <option value="52">Costa Rica</option>
    <option value="53">Cote D'Ivoire</option>
    <option value="54">Croatia</option>
    <option value="55">Cuba</option>
    <option value="56">Cyprus</option>
    <option value="57">Czech Republic</option>
    <option value="58">Denmark</option>
    <option value="59">Djibouti</option>
    <option value="60">Dominica</option>
    <option value="61">Dominican Republic</option>
    <option value="62">Ecuador</option>
    <option value="63">Egypt</option>
    <option value="64">El Salvador</option>
    <option value="65">Equatorial Guinea</option>
    <option value="66">Eritrea</option>
    <option value="67">Estonia</option>
    <option value="68">Ethiopia</option>
    <option value="69">Falkland Islands</option>
    <option value="70">Faroe Islands</option>
    <option value="71">Fiji</option>
    <option value="72">Finland</option>
    <option value="73">France</option>
    <option value="74">French Guiana</option>
    <option value="75">French Polynesia</option>
    <option value="76">French S. &amp; Antarctic Lands</option>
    <option value="77">Gabon</option>
    <option value="78">Gambia, The</option>
    <option value="79">Gaza Strip</option>
    <option value="80">Georgia</option>
    <option value="81">Germany</option>
    <option value="82">Ghana</option>
    <option value="83">Gibraltar</option>
    <option value="84">Greece</option>
    <option value="85">Greenland</option>
    <option value="86">Grenada</option>
    <option value="87">Guadeloupe</option>
    <option value="88">Guatemala</option>
    <option value="89">Guinea</option>
    <option value="90">Guinea-Bissau</option>
    <option value="91">Guyana</option>
    <option value="92">Haiti</option>
    <option value="93">Honduras</option>
    <option value="94">Hong Kong</option>
    <option value="95">Hungary</option>
    <option value="96">Iceland</option>
    <option value="97">India</option>
    <option value="98">Indonesia</option>
    <option value="99">Iran</option>
    <option value="100">Iraq</option>
    <option value="101">Ireland</option>
    <option value="102">Israel</option>
    <option value="103">Italy</option>
    <option value="104">Jamaica</option>
    <option value="105">Japan</option>
    <option value="106">Jordan</option>
    <option value="107">Kazakhstan</option>
    <option value="108">Kenya</option>
    <option value="109">Kiribati</option>
    <option value="110">Kuwait</option>
    <option value="111">Kyrgyzstan</option>
    <option value="112">Laos</option>
    <option value="113">Latvia</option>
    <option value="114">Lebanon</option>
    <option value="115">Lesotho</option>
    <option value="116">Liberia</option>
    <option value="117">Liechtenstein</option>
    <option value="118">Lithuania</option>
    <option value="119">Luxembourg</option>
    <option value="120">Macau</option>
    <option value="121">Macedonia</option>
    <option value="122">Madagascar</option>
    <option value="123">Malawi</option>
    <option value="124">Malaysia</option>
    <option value="125">Maldives</option>
    <option value="126">Mali</option>
    <option value="127">Malta</option>
    <option value="128">Marshall Islands</option>
    <option value="129">Martinique</option>
    <option value="130">Mauritania</option>
    <option value="131">Mauritius</option>
    <option value="132">Mayotte</option>
    <option value="133">Mexico</option>
    <option value="134">Micronesia, Fed. States</option>
    <option value="135">Moldova</option>
    <option value="136">Monaco</option>
    <option value="137">Mongolia</option>
    <option value="138">Montserrat</option>
    <option value="139">Morocco</option>
    <option value="140">Mozambique</option>
    <option value="141">Namibia</option>
    <option value="142">Nauru</option>
    <option value="143">Nepal</option>
    <option value="144">Netherlands</option>
    <option value="145">Netherlands Antilles</option>
    <option value="146">New Caledonia</option>
    <option value="147">New Zealand</option>
    <option value="148">Nicaragua</option>
    <option value="149">Niger</option>
    <option value="150">Nigeria</option>
    <option value="151">Niue</option>
    <option value="152">Norfolk Island</option>
    <option value="153">North Korea</option>
    <option value="154">Norway</option>
    <option value="155">Oman</option>
    <option value="156">Pakistan</option>
    <option value="157">Palau</option>
    <option value="158">Panama</option>
    <option value="159">Papua New Guinea</option>
    <option value="160">Paraguay</option>
    <option value="161">Peru</option>
    <option value="162">Philippines</option>
    <option value="163">Pitcairn Islands</option>
    <option value="164">Poland</option>
    <option value="165">Portugal</option>
    <option value="166">Puerto Rico</option>
    <option value="167">Qatar</option>
    <option value="168">Reunion</option>
    <option value="169">Romania</option>
    <option value="170">Russia</option>
    <option value="171">Rwanda</option>
    <option value="172">S. Georgia &amp; Sandwich Islands</option>
    <option value="173">Saint Kitts and Nevis</option>
    <option value="174">Saint Lucia</option>
    <option value="175">Samoa</option>
    <option value="176">San Marino</option>
    <option value="177">Sao Tome and Principe</option>
    <option value="178">Saudi Arabia</option>
    <option value="179">Senegal</option>
    <option value="180">Serbia</option>
    <option value="181">Seychelles</option>
    <option value="182">Sierra Leone</option>
    <option value="183">Singapore</option>
    <option value="184">Slovakia</option>
    <option value="185">Slovenia</option>
    <option value="186">Solomon Islands</option>
    <option value="187">Somalia</option>
    <option value="188">South Africa</option>
    <option value="189">South Korea</option>
    <option value="190">Spain</option>
    <option value="191">Sri Lanka</option>
    <option value="192">St. Vincent &amp; The Grenadines</option>
    <option value="193">Sudan</option>
    <option value="194">Suriname</option>
    <option value="195">Svalbard</option>
    <option value="196">Swaziland</option>
    <option value="197">Sweden</option>
    <option value="198">Switzerland</option>
    <option value="199">Syria</option>
    <option value="200">Taiwan</option>
    <option value="201">Tajikistan</option>
    <option value="202">Tanzania</option>
    <option value="203">Thailand</option>
    <option value="204">Togo</option>
    <option value="205">Tokelau</option>
    <option value="206">Tonga</option>
    <option value="207">Trinidad and Tobago</option>
    <option value="208">Tunisia</option>
    <option value="209">Turkey</option>
    <option value="210">Turkmenistan</option>
    <option value="211">Turks and Caicos Islands</option>
    <option value="212">Tuvalu</option>
    <option value="213">Uganda</option>
    <option value="214">Ukraine</option>
    <option value="215">United Arab Emirates</option>
    <option value="3">United Kingdom</option>
    <option value="1">United States</option>
    <option value="216">Uruguay</option>
    <option value="217">Uzbekistan</option>
    <option value="218">Vanuatu</option>
    <option value="219">Vatican City</option>
    <option value="220">Venezuela</option>
    <option value="221">Vietnam</option>
    <option value="222">Virgin Islands</option>
    <option value="223">Wallis and Futuna</option>
    <option value="224">Western Sahara</option>
    <option value="225">Yemen</option>
    <option value="226">Zambia</option>
    <option value="227">Zimbabwe</option>
    </select>
    <br />
    <label for="month">Born on:</label>
    <select name="month" id="month" onchange="updateDay('month','JoinForm','year','month','day')">
    <option value="1" selected="selected">January</option>
    <option value="2">February</option>
    <option value="3">March</option>
    <option value="4">April</option>
    <option value="5">May</option>
    <option value="6">June</option>
    <option value="7">July</option>
    <option value="8">August</option>
    <option value="9">September</option>
    <option value="10">October</option>
    <option value="11">November</option>
    <option value="12">December</option>
    </select>
    <select name="day" id="day">
    <option value="1" selected="selected">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    <select name="year" id="year" onchange="updateDay('year','JoinForm','year','month','day')">
    <option value="1912" selected="selected">1912</option>
    <option value="1913">1913</option>
    <option value="1914">1914</option>
    <option value="1915">1915</option>
    <option value="1916">1916</option>
    <option value="1917">1917</option>
    <option value="1918">1918</option>
    <option value="1919">1919</option>
    <option value="1920">1920</option>
    <option value="1921">1921</option>
    <option value="1922">1922</option>
    <option value="1923">1923</option>
    <option value="1924">1924</option>
    <option value="1925">1925</option>
    <option value="1926">1926</option>
    <option value="1927">1927</option>
    <option value="1928">1928</option>
    <option value="1929">1929</option>
    <option value="1930">1930</option>
    <option value="1931">1931</option>
    <option value="1932">1932</option>
    <option value="1933">1933</option>
    <option value="1934">1934</option>
    <option value="1935">1935</option>
    <option value="1936">1936</option>
    <option value="1937">1937</option>
    <option value="1938">1938</option>
    <option value="1939">1939</option>
    <option value="1940">1940</option>
    <option value="1941">1941</option>
    <option value="1942">1942</option>
    <option value="1943">1943</option>
    <option value="1944">1944</option>
    <option value="1945">1945</option>
    <option value="1946">1946</option>
    <option value="1947">1947</option>
    <option value="1948">1948</option>
    <option value="1949">1949</option>
    <option value="1950">1950</option>
    <option value="1951">1951</option>
    <option value="1952">1952</option>
    <option value="1953">1953</option>
    <option value="1954">1954</option>
    <option value="1955">1955</option>
    <option value="1956">1956</option>
    <option value="1957">1957</option>
    <option value="1958">1958</option>
    <option value="1959">1959</option>
    <option value="1960">1960</option>
    <option value="1961">1961</option>
    <option value="1962">1962</option>
    <option value="1963">1963</option>
    <option value="1964">1964</option>
    <option value="1965">1965</option>
    <option value="1966">1966</option>
    <option value="1967">1967</option>
    <option value="1968">1968</option>
    <option value="1969">1969</option>
    <option value="1970">1970</option>
    <option value="1971">1971</option>
    <option value="1972">1972</option>
    <option value="1973">1973</option>
    <option value="1974">1974</option>
    <option value="1975">1975</option>
    <option value="1976">1976</option>
    <option value="1977">1977</option>
    <option value="1978">1978</option>
    <option value="1979">1979</option>
    <option value="1980">1980</option>
    <option value="1981">1981</option>
    <option value="1982">1982</option>
    <option value="1983">1983</option>
    <option value="1984">1984</option>
    <option value="1985">1985</option>
    <option value="1986">1986</option>
    <option value="1987">1987</option>
    <option value="1988">1988</option>
    <option value="1989">1989</option>
    <option value="1990">1990</option>
    <option value="1991">1991</option>
    <option value="1992">1992</option>
    <option value="1993">1993</option>
    <option value="1994">1994</option>
    </select>
    <br />
    </div>
    <br />
    <input type="button" value="Join Now - Free!" onclick="submitJoinForm();" class="button" style=" padding-left: 5px; padding-right: 5px; cursor: pointer; cursor: hand;" />
    <div id="terms"><input name="privacy_policy" type="checkbox" value="true" id="agree" checked> <label for="agree"> I&#39;ve read and agree to the <a href="javascript:winpop('./_themes/main/the_bear/popup/term_cond.html','960','600','yes');">Terms & Conditions</a> and <a href="javascript:winpop('./_themes/main/the_bear/popup/priv_policy.html','960','600','yes');">Privacy Policy</a></label></div>
    </form>
    </td></tr></table>
    </div>
    <div class="userinfo-links-wide"></div>
    </div></div>
    </div></div>
    </div>
    </div>
    </div>
    <div id="shadow"></div>
    <div id="footer">
    <p>
    <a href="./news.php?view=1" title="How it works">How it works</a> |
    <a href="./help.php" title="Help">Help</a> |
    <a href="./news.php?view=2" title="About us">About us</a> |
    <a href="./partner/" title="Affiliates">Affiliates</a> |
    <a href="./news.php?view=3" title="Testimonials">Testimonials</a> |
    <a href="./news.php" title="News">News</a> |
    <a href="./contact.php" title="Contact us">Contact us</a>
    </p>
    <p class="abledating"><font color="#ff7500">2010 &copy Copyright by <!--Online contacts at --> <a href="./" title="BearGround.com">BearGround.com</a></a>. All rights reserved.</font></p>
    </div>
    </div>
    <div id="xajax_im"></div>
    <script>
    try { initAjax(); }
    catch(e) {};
    </script>
    </body>
    </html>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Verified AS3 bugs

    I found another serious AS 3 bug so i decided to write up a
    verification script so anyone can verify these bugs and hopefully
    someone over at adobe can squash them, as they are quite annoying
    and require a considerable amount of effort to work around.
    The first bug is a dynamically generated movieclip that has
    various UI components to it will report its height incorrectly but
    will display correctly
    The second bug is when a combobox has its value changed it
    generates a change event but for some reason, its parent
    displayobject does not detect the event.
    My project deals with auto layout of several dynamically
    generated movieclips that contain dozens of comboboxes so these two
    bugs combined are really getting on my nerves.
    The code to reproduce these bugs is below. Just copy and
    paste in a Flash IDE, add the combobox, checkbox and radiobutton
    componets to the FLA's library and launch. I had a screen shot of
    the height i measured with photoshop but doesn't look I can attach
    it. At any rate, flash outputs 174 and i measured 99 for a
    difference of 75.
    -------------------------------Sample Code
    Begin------------------------------------
    //omnidogg - Jan 18,2008
    //Code to illustrate 2 AS3 bugs
    // 1. ComboBox change event does bubble up to parent
    displayobject container
    // 2. Dynamically sized movieclip's height property displays
    correctly but the value returned from a get operation is incorrect
    // just copy and paste into Flash IDE.
    //import needed classes for example
    import fl.controls.CheckBox;
    import fl.controls.ComboBox;
    import fl.controls.RadioButton;
    import fl.controls.RadioButtonGroup;
    //create a empty movie that will be the parent display
    object, set backgroud to green, put around middle of stage
    var mc1:MovieClip = new MovieClip();
    this.stage.addChild(mc1);
    mc1.opaqueBackground = 0x00FF00;
    mc1.x = 50;
    mc1.y = 60;
    //create a combobox and add it to mc1. Add two choices to
    illustrate change event bubbling bug.
    //changing value in combo box generates an event but mc1 does
    not detect it.
    var cb1:ComboBox = new ComboBox();
    mc1.cb1 = mc1.addChild(cb1);
    mc1.cb1.x = 220;
    mc1.cb1.y = 30;
    mc1.cb1.addItem({label:"Choice 1"});
    mc1.cb1.addItem({label:"Choice 2"});
    //add a checkbox to mc1. This component behaves as expected.
    var chkb1:CheckBox = new CheckBox();
    chkb1.name = "chkb1";
    mc1.chkb1 = mc1.addChild(chkb1);
    mc1.chkb1.x = 220;
    mc1.chkb1.y = mc1.cb1.y + mc1.cb1.height + 10;
    mc1.chkb1.label = "Toggle";
    //add two radio buttons in default radiobuttongroup to mc1.
    selecting a new value generates 3 change events. I expected 2, 1
    for each radiobutton.
    //3rd from the radiobutton group? at least something is
    generated which is better than nothing
    var rb1:RadioButton = new RadioButton();
    mc1.rb1 = mc1.addChild(rb1);
    mc1.rb1.x = 180;
    mc1.rb1.y = mc1.chkb1.y + mc1.chkb1.height + 20;
    mc1.rb1.label = "Choice 1";
    var rb2:RadioButton = new RadioButton();
    mc1.rb2 = mc1.addChild(rb2);
    mc1.rb2.x = 260;
    mc1.rb2.y = mc1.chkb1.y + mc1.chkb1.height + 20;
    mc1.rb2.label = "Choice 2";
    //add a event listener to mc1 to detect any change events
    mc1.addEventListener(Event.CHANGE,traceChange);
    //trace the given text when a change event occurs
    function traceChange(event:Event):void
    trace("Change Event Detected");
    //trace height of movie clip with various UI components
    placed in it
    trace(mc1.height); //outputs 174, measurements from photoshop
    indicate 99. I can send a screenshot to anyone interested.
    -------------------------------Sample Code
    End--------------------------------------
    Of course if these have already been found and squashed,
    someone please point to me to the proper resources; seaches of the
    knowledgebase don't turn up any revelant info.
    Thanks

    The incorrect height value you're getting is a timing issue.
    Each these
    components has a TextField somewhere in its heirarchy, which
    is initialized
    at 100x100. The resizing of the TextField doesn't occur until
    after you've
    checked the height of the container MovieClip.
    If you listen for Event.ENTER_FRAME, you'll find that the
    correct value is
    returned once the component is fully rendered. In my test,
    the correct value
    was available on the 2nd ENTER_FRAME.
    Try this:
    this.addEventListener(Event.ADDED, _handler);
    this.addEventListener(Event.ADDED_TO_STAGE, _handler);
    this.addEventListener(Event.RENDER, _handler);
    this.addEventListener(Event.ENTER_FRAME, _efhandler);
    function _handler(event:Event)
    trace(event.type, event.target, mc1.height)
    var efcount:uint=0;
    function _efhandler(event:Event)
    efcount++;
    trace(event.type, event.target, mc1.height)
    if(efcount > 5) // i use 5, but can be fewer
    this.removeEventListener(Event.ENTER_FRAME, _efhandler);

Maybe you are looking for

  • Sync Pages from MacBook Pro to iPad?

    I have Pages 5.0 on my MacBook Pro. Can I sync it to my iPad and then use it to open .doc items? This is a problem for me using Firefox 28 and yahoo mail and for a friend who uses Safari.

  • Apple- Customer Service story- Fantastic service

    Firstly, thank you for taking the time to view this post. The reason for writing such a post is because I wish to thank Apple Support for their fantastic service, which I have just recieved today (Saturday 1 April 2013). The problem I was having was

  • How can I get list of columns used of specific table in all stored procedure?

    How can I get used column list of a specific table in among all stored procedure? Suppose that, I have a table(VendorMaster) which has 100 columns just I want to know how many columns used in among all stored procedure.

  • [CS4] Documents linked to other documents?

    When exporting a document for Digital Editions, InDesign is automatically trying to open another document. If it can't find that second document, the export fails - with the error message "undefined is not an object". If it DOES find the second docum

  • Nokia belle for nokia500

    Sir, i have heard that belle will be avaliable by feb 2012, is it true?