Author Topic: [Help]Radiobuttons & Comboboxes  (Read 2139 times)

alejoamiras

  • Member
  • **
  • Posts: 63
  • Karma: +0/-1
    • View Profile
[Help]Radiobuttons & Comboboxes
« on: Wed, Jul 13, 2011 »
Hey guys !

Is there a way of creating Combobox or Radiobuttons in flixel or flex or ... Flashdevelop, I think you know what I mean...

Okei, if there's a way can you explain it please :D

Thank you in advance :D !

Alejo.-
« Last Edit: Wed, Jul 13, 2011 by alejoamiras »

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Radiobuttons & Comboboxes
« Reply #1 on: Wed, Jul 13, 2011 »
I would use Minimal Comps: http://www.minimalcomps.com/
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

alejoamiras

  • Member
  • **
  • Posts: 63
  • Karma: +0/-1
    • View Profile
[Help]Radiobuttons & Comboboxes
« Reply #2 on: Wed, Jul 13, 2011 »
Hey I don't know how to initiate this...

I mean it doesnt appear and I don't know how to add it !

Please help photonstorm :D !

Code: [Select]
package 
{
/**
* ...
* @author Alejo Amiras
*/
import org.flixel.*;
import com.bit101.components.*;

public class MenuState extends FlxState
{
private var _ComboTipo:ComboBox;

public function MenuState()
{
}
override public function create():void {
FlxG.mouse.show();
_ComboTipo = new ComboBox(null, 10, 10, "Elegir Personaje", ["Chocolate", "Caca"]);
//add(_ComboTipo);

}

}

}

Thank you in advance :) !
« Last Edit: Wed, Jul 13, 2011 by alejoamiras »

alejoamiras

  • Member
  • **
  • Posts: 63
  • Karma: +0/-1
    • View Profile
Re: [Help]Radiobuttons & Comboboxes
« Reply #3 on: Wed, Jul 13, 2011 »
Help !! :(

ETG

  • Active Member
  • ***
  • Posts: 115
  • Karma: +0/-0
    • View Profile
Re: [Help]Radiobuttons & Comboboxes
« Reply #4 on: Wed, Jul 13, 2011 »
This is just a wild guess here, but you may have to add the object to flash's stage, not flixel's add().

zadvornykh

  • Active Member
  • ***
  • Posts: 205
  • Karma: +1/-0
    • View Profile
Re: [Help]Radiobuttons & Comboboxes
« Reply #5 on: Wed, Jul 13, 2011 »
If this is for some kind of menu and you want to have several components at once, you should create a MovieClip to make positioning easier. Add this MovieClip to FlxG.stage, and add the minimal components to that MovieClip.
« Last Edit: Thu, Jul 14, 2011 by zadvornykh »

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: [Help]Radiobuttons & Comboboxes
« Reply #6 on: Thu, Jul 14, 2011 »
Yup, MinimalComps are display objects - you can't add them to flixel (with add()), do as Zad said above.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

GrimPanda

  • Member
  • **
  • Posts: 46
  • Karma: +1/-0
    • View Profile
    • Grim Panda Games
Re: [Help]Radiobuttons & Comboboxes
« Reply #7 on: Thu, Jul 14, 2011 »
You can also use the flash native components (if you have that IDE), by just opening a new flash document, adding the necessary components you want to use to the library and then exporting a swc.  You can them call them normally in As3 projects.

http://joshblog.net/2008/02/10/how-to-use-the-flash-cs3-component-set-in-a-flex-builder-actionscript-project/

Is a good example of how to do this. 

Then simply:

Code: [Select]
import fl.controls.ComboBox;
import fl.data.DataProvider;
import fl.controls.RadioButton;
import fl.controls.RadioButtonGroup;

private var _myCombo:ComboBox = new ComboBox();
FlxG.stage.addChild(_myCombo);

etc...
"Mortis Ailuropoda"

Wenzl

  • Member
  • **
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: [Help]Radiobuttons & Comboboxes
« Reply #8 on: Fri, Aug 26, 2011 »
Another way is to import the fl.controls.* if you have flash.

I spend a lot of time to implement a proper interface in to the game. I looked into Minimal Comps but don't get it running. The "this" and "add" problem was not solvable for me. So I looked into swc solution from GrimPanda. I use FlashDevelop and created the swc in flash. Loaded it in to FlashDevelop and their in to the library. I couldn't include it in to the file.

So I ended up to import the  fl.controls.*;

maybe not the best solution.