dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] multiple selected checkboxes + label load

  1. #1
    Member
    Join Date
    Jan 2011
    Posts
    47

    resolved [RESOLVED] multiple selected checkboxes + label load

    i'm making a flash quiz that is loading random images and you answer with checkboxes but i have some problems with them.

    you have 3 answers to choose from but how can i make it that you can only check 1 box at a time?
    i have tried this:
    PHP Code:
    while (stelling_1.selected){
            
    stelling_2.enabled false
            stelling_3
    .enabled false
    }
    while (
    stelling_2.selected){
            
    stelling_1.enabled false
            stelling_3
    .enabled false
    }
    while (
    stelling_3.selected){
            
    stelling_1.enabled false
            stelling_1
    .enabled false

    and tried it with if's but it doesn't work

    my second problem is that the labels of the checkboxes are loaded and they are loaded with word-wrap but it only shows the second line when i go over it with the mouse.
    this is the code for the labels:
    PHP Code:
    function processXML(e:Event):void
    {
        var 
    embeddedFont:Font = new MyFont();
        var 
    textFormat:TextFormat = new TextFormat();
        var 
    myXML:XML = new XML(e.target.data);
        
    textFormat.font embeddedFont.fontName;
        
    textFormat.size 11;
        
    textFormat.color 0xFFFFFF;
        
    stelling_1.setStyle("textFormat"textFormat);
        
    stelling_1.setStyle("embedFonts"true);
        
    stelling_2.setStyle("textFormat"textFormat);
        
    stelling_2.setStyle("embedFonts"true);
        
    stelling_3.setStyle("textFormat"textFormat);
        
    stelling_3.setStyle("embedFonts"true);
        
    stelling_1.textField.wordWrap true;
        
    stelling_2.textField.wordWrap true;
        
    stelling_3.textField.wordWrap true;
        
    stelling_1.textField.multiline true;
        
    stelling_2.textField.multiline true;
        
    stelling_3.textField.multiline true;
        
    stelling_1.textField.width 490;
        
    stelling_2.textField.width 490;
        
    stelling_3.textField.width 490;
        
    trace(myXML.stelling1);
        
    trace(myXML.stelling2);
        
    trace(myXML.stelling3);
        
    stelling_1.label myXML.stelling1.text;
        
    stelling_2.label myXML.stelling2.text;
        
    stelling_3.label myXML.stelling3.text;
        
    addChild(stelling_1);
        
    addChild(stelling_2);
        
    addChild(stelling_3);

    steling_1, stelling_2 and stelling_3 are the checkboxes.

    and this one isn't necessary but it would help to get it solved sooner than i can figure it out ^^

    can i get different layouts for the 3 checkboxes when i change the layout of the first the layout of the second and third also change?
    there different symbols and have different linkage identifiers.

    thanks for all the help!!!

    and i don't get any errors from flash!

  2. #2
    Member
    Join Date
    Jan 2011
    Posts
    47
    i fixed the problem to be able to select multiple boxes i replaced them with radio buttons
    but i still have the problem with the labels

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center