Flex :: Dynamically Adding Radiobuttongroup In Application
Jan 13, 2010
I'm trying to make a quiz in flex and am loading data from an xml file. For each question I want to create a radiobuttongroup so I can associate radio buttons to it. How can I accomplish that with actionscript? I can see that addChild method works for DisplayObjects and I presume that radiobuttongroup is not one because I'm receiving errors. How can I dynamically add radiobuttongroup with actionscript in flex application?
View 2 Replies
Similar Posts:
Sep 8, 2009
I'm making a simple quiz. I dynamically create Sprites and on these Sprites I add dynamically created TextFields which take text from an XML file. The TextFields contain the questions. Now I want to add a RadioButtonGroup to each Sprite but every time I try to addChild I get the message telling me I cant coerce the RadioButtonGroup into a display object.
[Code]...
View 2 Replies
Sep 17, 2010
I have an J2EE Enterprise Application Project in which I would like to add a few Flex screens. How do I go about adding Flex capabilities.
I have build Flex/J2EE applications from scratch but can't think of the best way to do this.
I am currently using Flex Builder Plugin for IBM Rational Application Developer 7.5.
View 1 Replies
Aug 12, 2009
I have an AC with several questions and assoicated answers. These must be shown in a DG, and the idea is that the rows and colums of the DG are bound to the AC. For example, if the answer to question1 is Yes, the Yes-button must be true, and both the others must be false (as in normal radiobuttongroup behaviour). But when I change a button by clicking it, the actions datafield of the AC should change accordingly. Am I clear enough here?
It is ment for dynamic questionnaires.
<?xml version = "1.0"?>
<mx:Application xmlns:mx = "http://www.adobe.com/2006/mxml">
<mx:Script>
[Code].....
View 2 Replies
Oct 29, 2010
I have a Validator on a RadioButtonGroup of 2 Radios. There's a checkbox above the RadioButtonGroup whereby if checkbox.Selected, then the Radios are enabled. So the Validator is required if the checkbox.Selected. So far so good. The problem is once a radio gets selected, the RadioButtonGroup selectedValue gets set. When I uncheck the checkbox I set the radios to not selected, but the selectedValue on the RadioButtonGroup doesn't get reset -- it hold the previous value. I tried setting it to null but no luck.
Therefore if I check the checkbox again and submit, the Validator see a selectedValue on the RadioButtonGroup. Even though none of the radios are selected, validation passes. How can I reset the RadioButtonGroup to its initial state when I uncheck the CheckBox? I looked at the underlying code for RadioButtonGroup.selectedValue = null, and what it does is look for a radio in the with the parameter value. If it doesn't find it nothing gets set.
View 1 Replies
Sep 3, 2009
I have a flex app with lots of custom components, like custom buttons, comboBoxes etc. I am trying to add keyBoard shortcuts to the flex app. In doing so, I added a key-down listener to the app to listen for ctrl+shift key combination like this:
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
Then I dispatch a custom event that all of my custom components are listening for:
private function reportKeyDown(event:KeyboardEvent):void {
var evtObj:Object = new Object();
evtObj.keyEvent = event;
dispatchEvent(new CustomEvent(CustomEvent.SHORTCUT_KEYS_PRESSED, evtObj, true, false));
}
In my custom button component I have:
this.addEventListener(CustomEvent.SHORTCUT_KEYS_PRESSED, ShortCutKeysHandler, true);
So, if I go ctrl+shift+W then I want one instance of the custom button to get clicked. For some reason, the event never gets triggered and never gets to the ShortCutKeysHandler function.
View 1 Replies
Dec 15, 2011
I had tried to use the radioButtonGroup under the GridItem in flex4. but it is not working[code]...It is not working. If any one knows how to assign values to radioButtonGroup to call the showSetting() function.
View 1 Replies
Jul 27, 2009
I have a UI component that, for various reasons, I have to construct programatically. The component is a table of radio buttons grouped by column.Right now, I'm constructing the column groups like so:
private function createGroupsForItemList(items: XMLList): void {
for each (var item: XML in items) {
var rbGroup: RadioButtonGroup = new RadioButtonGroup();
groups[item.@level.toString()] = rbGroup;
}
}
I'm trying to associate the RadioButton instances with the column groups like so:
private function createValueControl(item: XML): UIComponent {
var control: RadioButton = new RadioButton();
control.label = "";
[code]...
I can see in the debugger that the control has an association to the group:
control.group == groups[item.@level.toString()]
However, I can see equally that the group does not know anything about the control:
group.radioButtons.length == 0
I imagine that this is because the setter for group in RadioButton is a dumb setter; all it does is copy to the variable, which doesn't do the magic that groupName does. However, I can't seem to find the value I should use to set the RadioButton.groupName property correctly.So, in short, I'm stumped on how to get these bits to talk to each other. How do I do this?
-- EDIT -- It turns out that I can have the groups created and associated simply by setting the groupName property, but I can't get at the group to set up a selection listener; the group is NULL immediately after the setting process, which means that the second line below throws the Flex equivalent of an NPE:
control.groupName = groupNameForLevel(item);
control.group.addEventListener(Event.SELECT, updateSelection);
View 2 Replies
Jun 23, 2011
I have an AdvancedDataGrid being built dynamically from an html table. The html is provided by a server so my code has to work dynamically for different columns/rows.
I have the columns being built and they display properly, however when I get to adding the rows is where i have issues. the follow code snippet shows iterating over all of the columns and adding a value under each of those columns to an object (to make a complete row) and then adding that to the ArrayCollection that later gets set to the dataProvider for the AdvancedDataGrid
//create an item to work with
var chartItem:Object = new Object();
for( var j:int = 0; j < columnResult.length ; j++ )
{
[Code]....
my issue is that when "head" has a value of 0, as in the column title is '0', the item is added at position [0] instead of at 0 as a string.
I looked up some examples and tried with:
chartItem.head but that just assumes the column title is 'head' instead of grabbing the value of the head var
View 1 Replies
Sep 8, 2011
I have been stuck on this for far too long. I think it's simple so I must be misunderstanding something. I want these to display across the full width of my flash app. When I shrink the width of the flash player I want a scrollbar to appear. At the moment no scroll bar is appearing.
[Code]...
View 1 Replies
Jul 1, 2009
i used blue.css and also beige.css in flex .i have theme combobox for user changed theme dynamically so i stroed
[Bindable]
private var pickcss:Array=["blue.css","beige.css"];
private function css_initializeHandler(event:Event):void
[code]........
View 2 Replies
Dec 9, 2009
Does anybody know how to add a new row to a datagrid via a checkbox.
example:
checkbox 1 : label (PS2)
checkbox 2 : label (PS3)
checkbox 3 : label (PSP)
By selecting one or all of these checkboxes i what to add a new Datagrid row.
Datagrid
Console price
row1 PS2 $20,
row2 PS3 $30,
row3 PSP $15,
View 1 Replies
Feb 4, 2011
I have an AIR app that gets bundled with XML files that the app needs. These get put into the APP Storage Directory, of course. Works great. But when I install a new version ( which includes new XML files) , the new files don't get added or overwrite the ones from the previous version. It seems that if that directory is there from a previous install, the installer will ignore the part where it moves included files.
View 1 Replies
Aug 4, 2011
I've a custom component where I do some graphics (e.g draw a line) and dynamically add a subcomponent (e.g a label) to it.
If I base the component off Group (which is recommended as per docs since its a spark component) then when I dynamically add a label the graphics part disappears.
However if I base it off Canvas this doesn't happen.
Why is that the case?
Here is the code.
MyComponent.as
public class MyComponent extends Group
{
public var x1:int;
[Code].....
View 2 Replies
Oct 27, 2011
I have a game where i add some cartoonish ants, that when they are clicked, they need to be removed from stage. There are 4 differend kinds of ants, so im doing a Math.random for picking which one to add. (ant 1+2+3 have 50% chance to spawn and 4th 50%)
Code:
rnd_nbr = (Math.random() * 5)+1;
I have a timer doing 10 tick, and i reset the timer to make neverending. Then i have a math random and if sentences adding mc' to the stage with movement from Tweener, and event listeners for clicks. But i cant figure out how to remove them when clicked. I have done alot of failed tries right inside the click_candy_anty function. I've left them commented out.
Code:
import caurina.transitions.Tweener;
var ant_index:Array = new Array(10);//index for ants
var ant_number:int;
[Code].....
View 4 Replies
Jan 5, 2011
lets say i have a
var rdGroup:RadioButtonGroup = new RadioButtonGroup();
how can i assign the id
rdGroup.id = "id_RdGroup";
and how can i add this group inside a VBox say
var vbBox:VBox = new VBox();
vbBox.addElement(rdGroup);
this thing gives error. that property id not found.
View 1 Replies
Aug 30, 2011
how to align Label followed by RadioButtons in Flex 4.5:
RadioTest.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].....
View 1 Replies
Sep 21, 2011
I have a loop that goes through data from a book and displays it. The book is not consistent in it's layout so I am trying to display it in two different ways. First way(works fine) is to load the text from that section in to a panel and display it. The second way is to create a new panel (panel creates fine) and then add collapsable panels(nested) to that panel. Here is the code from the else loop.
else if (newPanel == false){
// simpleData is just for the title bar of the new panel
// otherwise the panel has no content
[Code]....
The error I get is: ReferenceError: Error #1069: Property panel4.4 not found on components.readTest and there is no default value.
I have tried setting the "name" property instead of the "id" property.
View 1 Replies
May 9, 2011
I put 2 RadioButton on stage and specify them as belonging to the same group. However, when I export them as a symbol and try to use it in AS3, I can't access that group, only individual buttons? How can I get the group into my symbol too?
View 2 Replies
Apr 8, 2009
My code is supposed to read an XML file, and present a question with 4 possible answers to the user. I am outputting my data fine, and even outputting corresponding radioButtons for my multiple choice question. I must be handling my radioButtonGroup incorrectly as when I test my movie, I can select 1, 2, or even all of my buttons. My trace statements outputs each button with the same group name.
[Code]...
View 1 Replies
Jan 14, 2009
EDIT2: Ok Both problems solved since I just found out how to randomize the array It took me three days to solve these problems lol At the third day I posted here but I got with the solutions by myself EDIT: lol ok Silly me.. I've just found out how to do that... Just adding a n in the answer texts solves this issue... I feel silly now =P ... However, I got another doubt, since I need to randomize the questions... Let's say I'd need 20 questions in total (with its respective answers). From those, I only need 10 to show... Ok, no problem here. The thing is, from those 20 possible questions, I need any 10 to appear randomly. I still can't found out how to randomize the items inside an array.
[Code]...
View 0 Replies
Oct 1, 2011
I tried something I did on a soundBoard I made with an external folder, but then I thought that folder will never be added on the phone, so how am I going to do this?
View 7 Replies
Apr 5, 2012
I am using RadioButtons within a radiobuttongroup. i want to change the order sequence of the radiobuttons of the group based on the end user's input.i have searched a lot, but all fell into vain.
I want to know whether it is possible to change the order of the radiobuttons?
View 1 Replies
May 25, 2010
Working in Flex 3, I have a series of components being rendered on a canvas, each of which should represent a single potential selection, ideally in a RadioButtonGroup. So in my parent canvas I am defining the RadioButtonGroup, and each component provides a single RadioButton. However, this doesn't seem to work.
[Code]...
So my guess was that at this point if, say, four of these components were added, the radio buttons would behave in mutually exclusive fashion and I'd be able to access myRadioButtonGroup.selectedValue to get the current selection. However, it doesn't seem to work that way. Is what I'm trying to do even possible, or have I maybe just missed something?
View 1 Replies
Aug 19, 2010
Here is my code:
var x : int = 50;
var group : RadioButtonGroup = new RadioButtonGroup();
for (var i : int = 0; i < 5; i++) {
[Code].....
when i run the application, it shows me "0". Why this?
View 1 Replies
Jan 26, 2009
I'm updating a sketch pad application for someone and I'm running into trouble creating a highlighter effect. What I'm trying to do is avoid having the highlighter opacity change when lines are drawn on top of each other. First I tried setting the line opacity to 50%. As expected, the opacity increases where the lines cross. So far, other sketch pad FLAs I've found have the same problem. Then I tried setting the opacity of the movie clip I'm drawing into to 50%, and drew lines at 100%. Surprisingly, the result is the same as above. Finally, I decided to just draw into a mask to reveal a 50% yellow mc below. But of course lines don't work in masks, so that didn't work either. I suppose I could draw a bunch of circles between points to create a line but that doesn't seem like it would be the best solution.
View 1 Replies
Mar 9, 2012
I am fairly new to AS3 but I have been able to build a somewhat dinky app for iPhone and Andoid with Flash CS5.5, and I am wanting to add my Flickr feed to it. I tried going through Flickr's API but that didn't fully work.
View 1 Replies
Oct 8, 2010
I'm trying to develop a simple mxml Flex application to start Skype from the AIR/Flashplayer runtime. Is it possible to get back events from a native Windows application? In the simple example of Skype, the OS returns control to the Flex app when Skype exits. But what about native applications which have their own event model and wants to communicate with the Flex event model. For example, a Face detection system which shows "Hello" on a Flex app when the camera detects a face. Can this be done in the current Flex framework?
View 1 Replies
Mar 4, 2011
I am working on an Adobe AIR Application. The size on Application window is 800X600 and is contains border container and border container contains many controls. What I want is to if user re-sizes the application then that container should also be re-sized according to scale. i.e If user maximizes or minimizes the window then that border container should also be maximized or minimized respectively.
View 3 Replies
Aug 4, 2011
How I will be back in Login Page after click of logout which is in application's component.
Project.mxml
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
[Code]....
View 2 Replies