LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-11-2005, 11:45 PM
Scottae's Avatar
Scottae Scottae is offline
God Moderator
 
Join Date: Oct 2003
Location: United States
Posts: 6,532
Rep Power: 16
Scottae is on a distinguished road
yuck CheckBox selected can't be set on an attached clip

I am having trouble with setting the selected property of a CheckBox component when the component is in an attached movie clip. Basically I have a class that is using attachMovie to attach a Flash pop up clip. It has a few check boxes on it. I am setting an initObj with the attachMovie to set variables on the timeline of the pop up clip. On the initObj I have some values that will have boolean values which will be used to set the check boxes to be checked or unchecked as soon as the attached movie is instantiated. The method that is doing this looks like this:

Actionscript:
public function showBackgammonInvitedUserPopup(pInviteId:Number, pAlias:String, pBalance:Number, pGameType:Number, pGameSettings:BackgammonGameSettings):Void
	{
		// Create a pop up window
		var initObj:Object = new Object ();
		initObj["inviteId"] = pInviteId;
		initObj["userName"] = pAlias;
		initObj["balance"] = pBalance;
		initObj["gameType"] = pGameType;
		initObj["gameSettings"] = pGameSettings;
		
		var invitedUserPopUp:MovieClip = _root.attachMovie("InvitedUserPopup", "InvitedUserPopup", 1000001, initObj);
		
		// Position the pop up.
		invitedUserPopUp._x = Stage.width / 2;
		invitedUserPopUp._y = Stage.height / 2;
		
	}

On the first frame of the attached clip, I am setting the selected propety of the check boxes to the values that were set to the timeline of the attached clip via the initObj. The code on the first frame of the attached pop up clip looks something like this:

Actionscript:
stop();

//  This is the game settings object we received when this pop up is created.
import classes.game.BackgammonGameSettings;
var gameSettings:BackgammonGameSettings;

// Now we need to extract all the properties from this object and populate the
// fields of this  pop up with that info.
import mx.controls.CheckBox;

var mCrawford:CheckBox;
var mJacoby:CheckBox;
var mAutoDouble:CheckBox;

mCrawford.selected = Boolean (gameSettings.mCrawford);
mJacoby.selected = Boolean (gameSettings.mJacoby);
mAutoDouble.selected = Boolean (gameSettings.mAutoDoubles);

Makes sense right? Should work, but it doesn't. In fact, all the check boxes are having their selected property set to true........which is odd since the default is false. I would feel better if they were all unchecked. At least I know there is something I am doing wrong. The wierd thing is, when I debug this I can see that the values are getting through. I even trace the selected properties of the check boxes and they are the correct values. But all the check boxes are checked. Wierd!
__________________
Our greatest glory is not in never falling but in rising everytime we fall. - Confucius

Blog | Shared Items
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Load a movie clip then set onPress not working? yossarian Actionscript 2.0 4 03-15-2006 12:01 PM
What is the best way to do this? rolento Newbies 29 12-09-2005 10:12 PM
Controlling the attached movie clip kryha Newbies 2 10-12-2005 03:03 PM
Checkbox selected state magnav0x Flash MX 2004 1 10-06-2005 12:56 PM
set coords within movie clip? aerosol General Flash 2 10-27-2000 06:59 PM




All times are GMT. The time now is 11:27 AM.