Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




TextInput Enabled Bug



Hi,

I've a small form with two TextInput components & two RadioButtons. Only one TextInput should be enabled at a time and you can alternate between them by clicking the appropriate radio button. (See below).



Unfortunately, the TextInput that is supposed to be disabled, can still except text, (you can see "efewf" in the disabled TextInput in the screenshot).

Is this a bug or is it my code?

Snippet from the event listener for the RadioButton


Code:
// Disable lower TextInput
this.owner.miniRegPage2.txtContactLocation._alpha = 50;
this.owner.miniRegPage2.txtContactLocation.enabled = false;
this.owner.miniRegPage2.txtContactLocation.editable = false;

// Enable lower TextInput
this.owner.miniRegPage2.txtPostcode.enabled = true;
this.owner.miniRegPage2.txtPostcode.editable = true;
this.owner.miniRegPage2.txtPostcode._alpha = 100;

Selection.setFocus(this.owner.miniRegPage2.txtContactLocation);



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-21-2005, 07:11 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Buttons Enabled/not Enabled Problem
I have a problem making a flash rpg game. I was reading many tutorials but I cant seem to do it correctly. I will appreciate any help!

This should work as follows: I have 100 hours to do some things like work, study etc. and each of these actions will reqire 1 hour to complete. After there will be 0 hours left, the buttons required for performing "work", "study" etc should be disabled.
Problem: When I reach 0 hours, it then start to count hours left upwards! 1,2,3...

This is the code:
// Variables
var money:Number = 0;
var hours:Number = 16;

//Button name :"work" (other buttons will have similar code)
on (release) {
money += 100,,
hours -= 1;
}

//Buttons enabled/disabled
if (hours < 1) {
work._alpha = 50;
work.enabled = false;
} else {
work._alpha = 100;
work.enabled = true;
}

Once again thanks for any help or suggestions!

[F8] TextInput.text +TextInput.text Doesnt Add
I'm trying to running this simple addition formula and am running into a problem.


PHP Code:




Label.text = TextInput_1.text + TextInput_2.text;







By default flash is concatenating the two numbers instead of adding them as I'm trying to do.
Does anybody know how I fix this problem?
Thanks!

How To Switch Between Flash Enabled Site To Non-Flash Enabled Site?
Can anyone please direct me to any tutorials or resources that would explain how to create an HTML link or a button that switches from a Flash Enabled site to a Non-Flash enabled site?

Thank you in advance!

X,Y And Z Enabled
Hello all,

what are your thoughts regarding enabling a true third diminution in Flash? By three dimensions, I mean X,Y and Z. do you think that Flash will ever head in that direction?

CGI-enabled ?
I want to upload a counter. I have to place textdb.pl in a CGI-enabled directory of my web site. What does that mean? and how do i do that?

Tab Enabled
How do you make you flash Mx 2004 document be tab enabled? I know in Flash MX, I did not have to do anything and everything could be accessed through tabs (buttons etc). Now, the tab key has no effect in my Flash MX 2004 document.

Generator Not Enabled?
I have been trying to get a scrolling text action script to work and i keep getting an error in the output which reads:
"Generator not enabled for this movie"
Anyone know what might be causing this?

Help With Button.enabled
i have a menu for my flash site with 5 buttons. Once one is clicked it goes to that section and disables the clicked button with button.enabled = false. This works fine, but when it is clicked, the hand cursor stays a hand cursor, instead of becoming a pointer, which it should do since its no longer enabled. The hand cursor stays until the mouse is moved off of the button. When moved back onto the button it is not a hand, which is good because it should not be. Anyone know how to fix this?

While + Enabled=false
why this don't work for disable my buttons???



function baloes(qual){
loadMovieNum(qual,4);
x=0;
while (x<=11){
_root.mv_datas.m_data[x].enabled=false;
x++;
trace (x);
}
}

thank's for any help...

Enabled Buttons
Hi!
I know the "enabled" (true and false) option for buttons in flash 6... but there are any script to enabled or disabled a movie clip which contains a lot of buttons?
thanks!
maga

My_btn.enabled
hey can someone help here ..
i have simply stated to disbale my_btn unitl there is some text in the field once there is then i enable my_btn
but my script isnt working . i have done this in the past but forgot how ..thanks for the help

Code:
my_btn.enabled=false;
Comments.text.length=0
if (Comments.text.length == 10) {
my_btn.enabled = true;
}
cheers

Flash Not Enabled...
is there such thing as a substitute graphic to replace the Flash area if someone doesn’t have Flash enabled?

Enabled Is Just Posing
first as3 project and i'm stuck again. any help would be appreciated.

i'm trying to disable a button and though it appears to be disabled (no pointy finger) if you click it it still traces out. example...


////////////////////////////////////////////////////

butt1.enabled = false;


butt1.addEventListener(MouseEvent.CLICK, button1Function);


function button1Function(event:MouseEvent):void{
trace("freakin poser");
}

////////////////////////////////////////////////////

This.enabled=false;
hello everyone, firstly let me say what a wonderful forum there seems to be alot of excelent knowledge and information contained here in.

My knowledge is limited at present but i will do my best in actively participating in your community.

On to my question, at present it is only a quick one.
Im currently well behind the times and using studio MX to create an elearning site for children, one of the games is a simple drag and drop application and i am trying to figure out a way to dissable the draggers once they are placed on the correct drop target.

so basicly the question is, is this.enabled=false; AS2 script or should it work in MX

if it wont work in AS1 are there any other options for acchiving the same result.

i have attached the .fla incase seeing it helps

many thanks and hearty hellos
Bill

Enabled Buttons
hello!

I whould apreciate any hint on this AS problem.

i have a swf(main movie) in which i placed several empty mc's loading external SWFs.(these have self preloaders).
in the main i placed invisible buttons. how can i make them enabled=true depending on if the external SWFs are already loaded.



Urgent matter...
the site i intend to make these changes is www.moveismonteiro.com
folow "moveis">"salas">"salas-geral". it works fine in ADSL connectins but may be kin of slow in analogic lines under 56K.

thanks a lot for any help....

_level.enabled
hi,

This is monu,
I have a .swf file(_level0) with some buttons and i am loding one more .swf(_level1) file while clicking one of the button in _level0. when it opened i want to enabled _level0. buttons so for that i worte...

on(release)
{

_level0.enabled = false;
}

but it is not working.....
i don't want to write each button name.enabled = false; bcaz i have so many buttons in _level0
Plz help me

Help With Enabled Buttons
I am looking for a way to enable/disable all buttons in a swf. I found this searching here but I don't understand it, and am looking for some of the many ways, as mentioned.

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid=1240137&highlight_key=y&keyword1=enabled

I am messing with having things load in what I call "windows" and when you close a window, basically it just collapses the .swf. The problem I have is that the cursor reacts to roll overs and I can still rollover buttons in the swf even though its collapsed. To see this prob go to:
www.custom-differentials.com

and open the gallery, then drag the gallery to the middle of the screen, close the gallery, then move the mouse around the outside of the "title bar" and watch the mouse change colors even though there is nothing there. I put a trace in the rollover handlers so I know which buttons are causing this. I just would like a broad sweep disable all buttons while the window is closed.

Thanks in advance for any help.

SimpleButton.enabled
quote:
A Boolean value that specifies whether a button is enabled. When a button is disabled (the enabled property is set to false), the button is visible but cannot be clicked. The default value is true. This property is useful if you want to disable part of your navigation; for example, you might want to disable a button in the currently displayed page so that it can't be clicked and the page cannot be reloaded.


btn.addEventListener('click',clicky);
function clicky(evt){
trace("HELLO");
}
btn.enabled = false;

I click btn. It says HELLO. Why??

Enabled And Disabled - Help Please
Hi all,

I have this movieclip with buttons residing in the main timeline. This movieclip is set with an _alpha = 0. How do I disabled this movieclip/buttons in the main timeline as well? The movieclip will be visible only if another button(not within this movieclip) is pressed.

I tried using the following but it doesn't work.

movieclipInstanceName.enabled = false;

How do I go about doing it?

Thanks for any input in advance.

.enabled And ._alpha Help Please?
Hey people,
i am creating this matching game thing where ppl have to click an item and its corresponding name Eg. i will place buttons of a circle, square and a triangle with the buttons namecircle, namesquare and nametriangle..
so if a user clicks on circle i do a
var target = "circle"; (where target will help me decide if its wrong or not)
then the user gets an option to click on the 3 words.
the actionscript for my namecircle is as such :

on(release){
if (target == "circle"){
score++;
circle._alpha=0;
circle.enabled=false
wordcircle._alpha=0;
wordcircle.enabled=false;
}
//the above just made the correct answers disappear and add a point.
else{
???._alpha=0;
???.enabled=false;
wordcircle._alpha=0;
wordcircle.enabled=false
}
}


Ok this is where the problem comes in, i have set the name of the picture same as the target variable. so how do i replace the ??? with the variable, cos normally you place the itemname._alpha ..but can i use a variable(since it shares the same name as the itemname) there instead?

Thanks in advance

Enabled Not Working.
ok so basically I want to target a parent mc and disable it from within a nested mc but I cant even figure out how to disable it from the parent timeline.

the clip instance is called tips and I have tried

tips.enabled = false;
and
tips.mouseEnabled =false;

with no luck

the actual tips movie clip has no children but I even tried mouseChildren = false;

Any clues would be great
Thanks Guys.

Enabled And Disabled - Help Please
Hi all,

I have this movieclip with buttons residing in the main timeline. This movieclip is set with an _alpha = 0. How do I disabled this movieclip/buttons in the main timeline as well? The movieclip will be visible only if another button(not within this movieclip) is pressed.

I tried using the following but it doesn't work.

movieclipInstanceName.enabled = false;

How do I go about doing it?

Thanks for any input in advance.

Testing If Javascript Is Enabled
hey guys
basically what i want to do is have a button that on release
tests to see if javascript is enabled and if so get url "javascript:winopen()" and if not get url "blah.html"
but im not sure how to go about the testing if javascript is enabled
any help would be great

thnx

Enabled Script For MovieClip's
I am using the enabled function and it wont' work!


I have loaded an swf on level 10 over the main movie...but the underlying buttons on level0 are still active, so normally I just use

button.enabled = false;

this time I am using a movie clip to act as the button...as far as I know its the same code...I am using

_root.1_mbut.enabled = 0;

but I get an error message in my code box:

Scene=Scene 1, Layer=actions, Frame=1: Line 4: ';' expected
_root.1_mbut.enabled = 0;

any solutions?

Mouse Enabled Out Of Screen
I was making a game where you are a sniper man and you aim and shoot things. I wanted to use the mouse to aim at stuff, which works, until the mouse is at the edge of the flash window. When my mouse is located here, out of sreen it doesn't move anymore. I was wondering if there was a way to make flash understands that my mouse would be still moving even if it can't! like in some good first person shooter games. I mean that in those you don't see the mouse and even if you move the mouse pointer so far to a side, the game still works and not mine... Hope you understand...

[MX] Enabled = True Problem
hi there,

I created a menu with animated buttons in it.the buttons have rollover,rollOut and release events. when a button is clicked the button is disabled using the 'enabled = false' command. now when an other button in the menu is clicked all the buttons are enabled again using the 'enabled = true' command followed by a gotoAndStop so the button is in its original state again. the problem is that I want to use an animation to go the the original state again. but with my script al the buttons move to their original state. the script I used to enable the buttons again is:

function reActivateMenu()
{
ani_main.gotoAndStop(1);
button_main.enabled = true;

ani_about.gotoAndStop(1);
button_about.enabled = true;

ani_work.gotoAndStop(1);
button_work.enabled = true;

ani_contact.gotoAndStop(1);
button_contact.enabled = true;
}


I hope you understands what my problem is. There should be a way to achieve the effect I want. I hope you guys (and girls) can help me with it.

Thanks alot

Cheers

[MX] Enabled = True Problem
hi there,

I created a menu with animated buttons in it.the buttons have rollover,rollOut and release events. when a button is clicked the button is disabled using the 'enabled = false' command. now when an other button in the menu is clicked all the buttons are enabled again using the 'enabled = true' command followed by a gotoAndStop so the button is in its original state again. the problem is that I want to use an animation to go the the original state again. but with my script al the buttons move to their original state. the script I used to enable the buttons again is:

function reActivateMenu()
{
ani_main.gotoAndStop(1);
button_main.enabled = true;

ani_about.gotoAndStop(1);
button_about.enabled = true;

ani_work.gotoAndStop(1);
button_work.enabled = true;

ani_contact.gotoAndStop(1);
button_contact.enabled = true;
}


I hope you understands what my problem is. There should be a way to achieve the effect I want. I hope you guys (and girls) can help me with it.

Thanks alot

Cheers

Swf Behind Javascript Enabled Div Problems
Here's the page:

http://squarehead.myvnc.com/sunwize/dev/index_dev.html

This page is scripted to provide drob-down menus and expanding panels - all divs (click on titlebars of lower panels). I haven't addressed IE bugs yet so use FireFox or Safari please.

The large promotional image panel contains a Flash movie and none of panels work properly. I developed with a jpg in that spot and everything worked fine. Now, depending on the browser, bits and pieces disappear, links cause problems - check it out and you'll see. Any clue whats going on here? Is it simply not possible to put divs on top of a Flash movie?

Steve

Is It A Bug? Button Cursor And .enabled?
After setting ...


PHP Code:




button.enabled = false;







...the "push cursor" remains until you completely drag your cursor off the button. Is there a means to have the cursor immidiately register that it has been disabled, and no longer show that cursor (without having to move mouse off the button)?

Enabled = False Isn't Instant ?
i've been trying to disable a button in actionscript but both

enabled = false;
and delete this.onRelease dont seem to be completely instant and i can double click the button if i go pretty fast, do i really have to implement a doubleclick check on the button ? doesn't make sense but what other ways could i do it that dont have that "lag" ?

_levelx.enabled - Does It Work ?
hi

this is my first post in this great foum !!

i'm loading a swf file on top of another but
I want to disable the lower level so that the buttons
won't work.
I've tried level6.enabled = false but it doesn't work
is there something i'm missing
I guess i could go and disable handCursor and all the buttons on the
lower leve but i was looking for a more universal solution.

any help ??

Enabled Property Question
Is it possible to keep a movieclip from receiving click events. In AS2 you could use the enabled property. But in AS3 this makes a button stop acting as a button, but the button still triggers events.

Masking CSS-enabled Text?
Right, more text-masking questions!

To mask a regular textfield, one has to embed the glyphs right? When you do this on a CSS enabled textfield, the text disappears. Well, that kind of sucks, because you need to embed the glyphs to mask the text! Hmm, is there any way at all to mask css enabled text?

Thanks people

Password Enabled Download
How can this be done? Password to enable a download of a pdf. Button click would bring up a dialog box asking for a password, the correct password would be entered enabling a pdf to be downloaded. Flash site, Dreamweaver, Action Script 2.0.
Thank you

Browser Scrollbars Not Enabled
Hi all,

Please check my website if u have a minute.

www.marklawrencedesign.com

What I want to check is:

A - does the link called "portfolio" appear under my name at the bottom

B - How do I enable scrollbars for my site to help people with small monitor / resolution sizes view my site?

Any help is greatly appreciated,

Cheers

MovieClip Enabled At Certain Frame?
Hey!

I have a nested movie clip that acts like a button (rollover/out).
It goes from left to right (50 frames inside the main mc - 1 frame on the stage) and it's disabled, I have "button.enabled = false;" on that single frame on the stage.

I need it to go all the way to the right and become enabled when it gets to that last frame.
Now, I've tried putting "button.enabled = true;" on that last frame.. doesn't work.
Tried using and calling a function which checks if the button._currentframe == 50;... doesn't work.

What is the problem here?
What am I doing wrong?
Anyone, please?

Browser Scrollbars Not Enabled
Hi all,

Please check my website if u have a minute.

www.marklawrencedesign.com

What I want to check is:

A - does the link called "portfolio" appear under my name at the bottom

B - How do I enable scrollbars for my site to help people with small monitor / resolution sizes view my site?

Any help is greatly appreciated,

Cheers

Button.enabled Question
When i load an mc i turn off the buttons of the _parent.mc this way...

function buttonOff(item) {
if (_parent[item].enabled==true) { // default button is off
_parent[item].enabled = false;
}
}

buttonOff ("icon_csm_mc")
buttonOff ("icon_saturn_mc")
buttonOff ("icon_sr_mc")
buttonOff ("icon_lm_mc")

When i try to turn the buttons on using the same method I fail...

function buttonOn (item) {
close_acronyms_btn.onRelease = function () { // child of above mc
_parent.gotoAndPlay (2);
if (_parent._parent[item].enabled = false) {
_parent._parent[item].enabled = true;
}
}
}

buttonOn ("icon_csm_mc")
buttonOn ("icon_saturn_mc")
buttonOn ("icon_sr_mc")
buttonOn ("icon_lm_mc")

Any help?

Password Enabled Download
How can this be done? A password to enable a download of a pdf. Button click on a button would bring up a dialog box asking for a password, the correct password would be entered enabling a pdf to be downloaded. Flash site, Dreamweaver, Action Script 2.0.
Thank you

Re: Password Enabled Download
you'll need to use server-side coding with flash to have anything remotely secure.

Button Enabled Timer?
Okay, So I have a flash file which works on a 1fps setting with countdown timers*. These are fixed timers which countdown and then repeat for about 15mins but what I need is a 2min timer I can start at any point in the time line and will count down and when finished will stop until the button is pushed again. Do any of you know how to do this?

*Changes every frame to one less

Thanks for any help

-Tim

Radio Button Bug .enabled?
I have been writing a fairly complex testing application for my job, and have been agonizing over this problem for over a month.

I have created a dynamic testing application that reads from XML, and my radiobutton class works splendidly, except for that when a user is prompted to review the exam, and the enabled parameter is set to false (no longer allowing a user to change the submitted submitted radiobutton answers), I loose the formatted text size for that radio button label. I am dealing with ADA issues, so allowing them to see the proper text size when reviewing their exam is of utmost importance. I am with them being grayed out, i just need to be able to maintain that the buttons are disabled, but the text size remains the same. I have tried re-applying my format to the radio buttons after setting rb.enabled = false; but it doesn't do anything....

Any help would be greatly appreciated.....







Attach Code

stop();
//import flash.display.DisplayObject;
//import flash.events.*;
import fl.managers.FocusManager;
import flash.display.InteractiveObject;

//var child_yo: DisplayObject = new DisplayObject ();

// addChild(child_yo);
stage.focus = this;
this.addEventListener(KeyboardEvent.KEY_UP, _onKeyDown);

//square_listener.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown);

function _onKeyDown(event:KeyboardEvent) {
if (event.keyCode == 39 && question_cycle + 1 < xmlData_2.questions.length())
{
next_question(null);
trace("upKey");
}

if (event.keyCode == Keyboard.ENTER && question_cycle + 1 < xmlData_2.questions.length())
{
next_question(null);
trace("upKey");
}

if (event.keyCode == 37 && question_cycle > 0)
{
last_question(null);
trace("downKey");
}
trace(question_cycle +"<"+ xmlData_2.questions.length);
trace("keyDownHandler: " + event.keyCode + "this is enter!");
//trace("ctrlKey: " + event.ctrlKey);
//trace("keyLocation: " + event.keyLocation);
//trace("shiftKey: " + event.shiftKey);
//trace("altKey: " + event.altKey);
stage.focus = this;

}
//this is a fix for messed up keybourd input.
var myFM:FocusManager = new FocusManager (masterFocus); var nextFMComponent:InteractiveObject; stage.stageFocusRect = false; setMasterFocus (); function setMasterFocus ():void { masterFocus.focusRect = false; masterFocus.addEventListener (FocusEvent.FOCUS_OUT, FocusOutMaster); nextFMComponent = masterFocus; myFM.setFocus (nextFMComponent); } function FocusOutMaster (event:FocusEvent):void { nextFMComponent = masterFocus; myFM.setFocus (nextFMComponent); }




//this formats text like a style sheet.
var error_Format:TextFormat = new TextFormat();
error_Format.size = font_size;
error_Format.color = 0xFFFFFF;

var nameFormat:TextFormat = new TextFormat();
nameFormat.size = font_size;
nameFormat.color = 0x226099;
nameFormat.font = "Arial Rounded MT Bold";

var name_box = new TextField();
name_box.multiline = false;
name_box.width = 330;
name_box.x = 30;
name_box.y = 15;

addChild(name_box);


if (first_name_value.length + last_name_value.length > 18){
var Combo_Name:String = first_name_value + " " + last_name_value;
name_box.text = Combo_Name.substring(0,19) + "...";
name_box.setTextFormat(nameFormat);
trace(Combo_Name +" adslkj;ffffa;lskdjfa;lksdjf;laksjdf;lakjsd;lfkajsdf");
} else {
name_box.text = "test session for: " + first_name_value + " " + last_name_value;
name_box.setTextFormat(nameFormat);
}


//this is the background osha logo
var logo_back_tran:logo_back_real = new logo_back_real;
addChild(logo_back_tran);
logo_back_tran.gotoAndPlay(1);

logo_back_tran.x = 300;
logo_back_tran.y = 220;

var title_holder:TextField = new TextField;
title_holder.type = TextFieldType.DYNAMIC;
title_holder.wordWrap = true;
//term_holder.autoSize = TextFieldAutoSize.LEFT;
title_holder.width = 500;
title_holder.height = 300;
title_holder.multiline = true;
//term_holder.setTextFormat(my_form_Format);
title_holder.x = 25
title_holder.y = 55;
title_holder.htmlText = xmlData.title_;
title_holder.setTextFormat(nameFormat);
addChild(title_holder);

var title_holder_scroller:UIScrollBar = new UIScrollBar();
title_holder_scroller.direction = ScrollBarDirection.VERTICAL;
title_holder_scroller.scrollTarget = title_holder;
title_holder_scroller.height = 324;
title_holder_scroller.move(580, 44);
addChild(title_holder_scroller);


//this represents the x position of the original question
var questionX:int = 60;
//this represents the y position of the original question
var questionY:int = 75;
//This represents the x position of the radio buttons
var answerX:int = 95;
//var answerY:int = question_answer_spacer;
var question_answer_spacer:int;
var spacing:int = 25;

var TestNumFieldX:int = 480;
var TestNumFieldY:int = 15;
var questionField = new TextField();
var TestNumField = new TextField();
var ErrorHandlerField = new TextField();
var theUserAnswer:int;
var theRealAnswer:Array = new Array;

var stored_answer_array:Array = new Array;
var stored_error_array:Array = new Array;
var stored_error_output:Array = new Array;
var stored_error_output_box:String = new String;
//these monitor that next and back buttons disappear and appear appropiatly
var back_but_toggler:Boolean = new Boolean;
var next_but_toggler:Boolean = new Boolean;
var help_but_toggler:Boolean = new Boolean;
var only_once_finish_but:Boolean = new Boolean;
//var question_scroller_toggler:Boolean = new Boolean;
//question_scroller_toggler = false;

var alpha_down_timer:Timer = new Timer(1, 100);
var alpha_up_timer:Timer = new Timer(1, 100);
//this is the new instance of the movie clip behind error handling for "are you sure you'd like to quite"
var newFinish:finish = new finish();
//this checks whether or not the user has submitted his/her exam...maybe cuz theres nothing below it

//variable for checking if frame two has arrived for flyout menu back button
one_two_frame_checker = true;
//variable for checking that finish_but children are not constantly added...
only_once_finish_but = true;

//these are the visual labels for the buttons

var next_graphic:next_arrow = new next_arrow();
var back_graphic:back_arrow = new back_arrow();
var question_graphic:question_mark = new question_mark();
var check_graphic:check_mark = new check_mark();
var check_or_x:results_graphics = new results_graphics();
check_or_x.x = 550;
check_or_x.y = 350;

var long_question_back:long_question_backer = new long_question_backer();
long_question_back.x = 30;
long_question_back.y = 60;

var error_border:error_png = new error_png();
error_border.x = 100;
error_border.y = 340;



ErrorHandlerField.x = 125;
ErrorHandlerField.y = 342;
//this formats text like a style sheet.
var myFormat:TextFormat = new TextFormat();
myFormat.size = font_size;
//myFormat.width = 400;
myFormat.font = "Times New Roman";

var num_fade_out:int = 1;
var num_fade_in:int;
var temp_holder;
//this keeps track of output for the stored_error_output:Array
var d:int = 0



//this condition substantiates that the next button has been clicked
back_but_toggler = true;
next_but_toggler = false;
help_but_toggler = true;



var holder_buts:MovieClip = new MovieClip();
holder_buts.x = 0;
holder_buts.y = 0;
addChild(holder_buts);

var holder:MovieClip = new MovieClip();
holder.x = 0;
holder.y = 0;
addChild(holder);

var return_but:Button = new Button();
return_but.label = "return to exam";
return_but.x = 220;
return_but.y = 270;

var end_but:Button = new Button();
end_but.label = "grade exam";
end_but.x = 350;
end_but.y = 270;




var next_but:Button = new Button();
next_but.label = "next";
next_but.x = 488;
next_but.y = 414;
next_graphic.x = 590;
next_graphic.y = 411;
holder_buts.addChild(next_but);

var back_but:Button = new Button();
back_but.label = "back";
back_but.x = 378;
back_but.y = 414;
back_graphic.x = 340;
back_graphic.y = 411;



var finish_but:Button = new Button();
finish_but.label = "Grade Exam";
finish_but.x = 20;
finish_but.y = 414;
check_graphic.x = 125;
check_graphic.y = 414;

var back_to_results:Button = new Button();
back_to_results.label = "Back to Results";
back_to_results.x = 20;
back_to_results.y = 414;

var help_but:Button = new Button();
help_but.label = "General Help";
help_but.x = 320;
help_but.y = 105;

var tip_but:Button = new Button();
tip_but.label = "Tip";
tip_but.x = 172;
tip_but.y = 414;
question_graphic.x = 285;
question_graphic.y = 410;


var question_scroller:UIScrollBar = new UIScrollBar();
question_scroller.direction = ScrollBarDirection.VERTICAL;

question_scroller.height = 85;
question_scroller.x= 597;
question_scroller.y= 64;


holder_buts.addChild(next_graphic);



//this gets the flyout menu ready to flow in frame 2, and checks if frame 3 has been done
if (frame_3_checker == false){
tween_handler.removeChild(size_picker);
tween_handler.removeChild(_last_continue_fly);
tween_handler.addChild( _back_fly);
tween_handler.addChild(help_but);}




help_but.addEventListener(MouseEvent.CLICK, general_help);
function general_help(event:MouseEvent):void {
tween_handler.fly_out_text.htmlText = xmlData.general_help;
}

tip_but.addEventListener(MouseEvent.CLICK, tips);

function tips(event:MouseEvent):void {

x_visible_timer.reset();
x_visible_timer.start();
//this toggles "clickability" for the button in question
tip_but.removeEventListener(MouseEvent.CLICK, tips);
trace("tip button is working great" + one_two_frame_checker)
}





var question_cycle:int = -1 ;



next_but.addEventListener (MouseEvent.CLICK, next_question);
back_but.addEventListener (MouseEvent.CLICK, last_question);
finish_but.addEventListener (MouseEvent.CLICK, GradeError);
return_but.addEventListener (MouseEvent.CLICK, back_test);
end_but.addEventListener (MouseEvent.CLICK, end_test);
back_to_results.addEventListener (MouseEvent.CLICK, back_results);

function back_results(event:MouseEvent):void {
gotoAndStop(3);
removeChild(holder);
removeChild(holder_buts);
if(question_cycle < 0){
removeChild(title_holder);
removeChild(title_holder_scroller);
}}

function back_test(event:MouseEvent):void {
holder.removeChild(newFinish);
holder.removeChild(return_but);
holder.removeChild(end_but);
}
function end_test(event:MouseEvent):void {
//holder.removeChild(newFinish);
//holder.removeChild(return_but);
//holder.removeChild(end_but);
removeChild(holder);
removeChild(holder_buts);

removeChild(finish_but);
holder_buts.removeChild(check_graphic);
gotoAndStop(3);
}



function next_question(event:MouseEvent):void {
if(question_cycle < 0){
removeChild(title_holder);
removeChild(title_holder_scroller);
logo_back_tran.gotoAndPlay(48);
holder_buts.addChild(error_border);
//this adds check graphics after the error border
if(test_done_checker==true){
holder_buts.addChild(check_or_x);
}
}
//if (question_scroller_toggler == true)
//{holder.removeChild(question_scroller);
//question_scroller_toggler = false;
//trace("question scroller toggler is" + question_scroller_toggler)
//}

question_cycle = question_cycle + 1;
trace("up");
toggle_questions();
//this toggles the content of the flyout menu
tween_handler.fly_out_text.htmlText = xmlData_2.questions[question_cycle].question_tip;
tween_handler.fly_scroller.update();

if (help_but_toggler == true && question_cycle > -1)
{

holder_buts.addChild(tip_but);
holder_buts.addChild(question_graphic);
question_graphic.gotoAndPlay(1);
help_but_toggler = false;
}

if (back_but_toggler == true && question_cycle > 0)
{
holder_buts.addChild(back_but);
holder_buts.addChild(back_graphic);
back_graphic.gotoAndPlay(1);
back_but_toggler = false;
}
trace(question_cycle + 1 + " vs. " + xmlData_2.questions.length());
if (question_cycle + 1 == xmlData_2.questions.length())
{
holder_buts.removeChild(next_but);
holder_buts.removeChild(next_graphic);
next_but_toggler = true;
}


}

function last_question (event:MouseEvent):void {
question_cycle = question_cycle -1;
//if (question_scroller_toggler == true)
//{holder.removeChild(question_scroller);
//question_scroller_toggler = false;
//trace("question scroller toggler is" + question_scroller_toggler)
//}
trace("down");
toggle_questions();
//this changes the content of the flyout menu box as well
tween_handler.fly_out_text.htmlText = xmlData_2.questions[question_cycle].question_tip;
tween_handler.fly_scroller.update();
if (question_cycle < 1)
{
holder_buts.removeChild(back_but);
holder_buts.removeChild(back_graphic);
back_but_toggler = true;

}
if (next_but_toggler == true)
{holder_buts.addChild(next_but);
holder_buts.addChild(next_graphic);
next_graphic.gotoAndPlay(1);
next_but_toggler = false;
}
}










//this is total keybourd functionality










var myGroup:RadioButtonGroup = new RadioButtonGroup("group1");
myGroup.addEventListener(Event.CHANGE, changeHandler);

function toggle_questions():void {

questionField.text = xmlData_2.questions[question_cycle].question_text;
questionField.autoSize = TextFieldAutoSize.LEFT;
questionField.multiline = true;

questionField.width = 500;


questionField.wordWrap = true;

questionField.x = questionX;
questionField.y = questionY;
questionField.selectable = true;

back_but.alpha = 1;

trace (question_answer_spacer + "here is the spacing");



while (holder.numChildren > 0) {

holder.removeChild(holder.getChildAt(0));
}
trace(holder.numChildren+"wazoo");


//this is the boundry box for larger questions
if (questionField.numLines > 3) {
holder.addChild(long_question_back);
long_question_back.gotoAndPlay(1);
}

holder.addChild(questionField);
questionField.setTextFormat(myFormat);
if (questionField.numLines > 3) {
trace("Yes O YEs baby Numlines are more than 3!")
questionField.autoSize = TextFieldAutoSize.NONE;
questionField.height = 75;
trace(questionField.height+"this is the height");

holder.addChild(question_scroller);

//this scroll target must remain here to reset properly
question_scroller.scrollTarget = questionField;
questionField.text = xmlData_2.questions[question_cycle].question_text;
questionField.setTextFormat(myFormat);
question_scroller.update();

//question_scroller_toggler = true;
};

question_answer_spacer = questionField.height;
if (questionField.numLines > 3) {
question_answer_spacer = questionField.height + 8 ;
}
for(var i:int = 0; i < xmlData_2.questions[question_cycle].choice.length(); i++) {


var rb:RadioButton = new RadioButton();

//trace("for loop is working")
rb.textField.autoSize = TextFieldAutoSize.LEFT;
rb.label = xmlData_2.questions[question_cycle].choice[i];

rb.textField.setTextFormat(myFormat);
rb.name = "googles"
rb.group = myGroup;
rb.value = i + 1;
rb.x = answerX;
rb.y = question_answer_spacer + 80 + (i * spacing);
//this checks to see if 'test done checker' has been substantiated, turns off enabled buttons, and makes sure that the old answers are reguritated.
if (test_done_checker==true){

rb.enabled = false;

if (rb.value == final_answer_array[question_cycle]){
rb.selected = true;

}

}

//this makes sure that previously answered questions are selected
if (rb.value == stored_answer_array[question_cycle]){
rb.selected = true;

}


//rb.setTextFormat(myFormat);
rb.setStyle("textFormat", myFormat);
holder.addChild(rb);

//holder.rb.setTextFormat(myFormat);




}



//trace (holder.numChildren +"Kazoo!");







TestNumField.text = "question " + (question_cycle + 1) + " of " + xmlData_2.questions.length();
TestNumField.autoSize = TextFieldAutoSize.LEFT;
TestNumField.x = TestNumFieldX;
TestNumField.y = TestNumFieldY;
holder.addChild(TestNumField);
TestNumField.setTextFormat(nameFormat);
//this checks to see that the test has not not been completed, and that the user has cycled through all of the questions
if (question_cycle + 1 == xmlData_2.questions.length() && test_done_checker==false && only_once_finish_but == true){
addChild(finish_but);
holder_buts.addChild(check_graphic);
check_graphic.gotoAndPlay(1);
trace("boobies...there's a problem")
only_once_finish_but = false;
}
//this tells you what you answered, and if it was wrong
if (test_done_checker==true){
holder.addChild(ErrorHandlerField);
ErrorHandlerField.text = grading_results_feedback[question_cycle];
ErrorHandlerField.autoSize = TextFieldAutoSize.LEFT;
ErrorHandlerField.setTextFormat(error_Format);
if (grading_results_feedback[question_cycle]== "incorrect"){
check_or_x.gotoAndPlay(2);
}
else{
check_or_x.gotoAndPlay(17);}
}

//this makes sure that the buttons don't overlap the flyout menu
removeChild(tween_handler);
addChild(tween_handler);


}

//this adds the back to results button to holder_buts if test_done_checker is true
if (test_done_checker==true){
holder_buts.addChild(back_to_results);

}




function changeHandler(event:Event) {
theUserAnswer = event.target.selectedData;
stored_answer_array[question_cycle] = theUserAnswer;

trace(theUserAnswer);
trace (stored_answer_array);
trace (stored_answer_array[question_cycle] + "Array is on");


}
trace (stored_answer_array[question_cycle] + "Array is on outside");

function GradeError (event:MouseEvent) {


for (var i:int = 0; i < xmlData_2.questions.length();i++)
{stored_error_array[i] = stored_answer_array[i]

if (stored_error_array[i]== null){
stored_error_output.push(i+1);


//d+1
trace(stored_error_output+"what does this look like working?");
}

}

//this prompts the error handler for "are you sure you want to quit"
if(stored_error_output[0] == null){
holder.addChild(newFinish);
holder.addChild(return_but);
holder.addChild(end_but);
newFinish.x = 300;
newFinish.y = 200;
check_graphic.gotoAndPlay(13);

}
//this is the error handling for unanswered questions
else{
holder.addChild(ErrorHandlerField);
trace(stored_error_output[0] +"!"+ stored_error_output[1]+"!"+ stored_error_output[2]+"!"+ stored_error_output[3] +"!"+ stored_error_output[4])
stored_error_output_box = stored_error_output.toString();


ErrorHandlerField.text = "Please answer " + stored_error_output_box + " before finishing test";
ErrorHandlerField.autoSize = TextFieldAutoSize.LEFT;
ErrorHandlerField.setTextFormat(error_Format);
trace(stored_error_output + "this is what your checking for")

stored_error_output = [];}




}

Enabled Button From A Load SWF
I am trying to turn buttons off and back on from a loaded SWF.

When loading an external SWF into an empty MC, the bottons on the root are still active underneath the loaded SWF.

I am using the following code on the button which loads the external SWF
on (release) {
loadMovie("1005.swf",_root.location);
}

and then from the first frame of the the loaded SWF I have
_root.compact.enabled = false
_root.compact.enabled = true

this is not working; the buttons are still active.....Can anyone please help.

Button.enabled = True; ?
Hey y'all
I'm having a pblm. when it comes to enabling a button(s) on/off .... I have a file; that with Adam14 and Scotty's help, I have working the way I want (swaping _X/_Y values), but when the button is cliked I want to disable it, untill another button is clicked... then enable it, and so on.

I thought of setting _global flags inside the buttons but then you actually have to click them twice to trigger the flags???? so then I took those flags out of the buttons and put them onto a container movieclip that looks something like this:

onClipEvent (enterFrame) {
if (_global.flag1 == true) {
_root.box1.button1.enabled = false;
_root.box2.button2.enabled = true;
_root.box3.button3.enabled = true;
} else if (_global.flag2 == true) {
_root.box1.button1.enabled = true;
_root.box2.button2.enabled = false;
_root.box3.button3.enabled = true;
} else if (_global.flag3 == true) {
_root.box1.button1.enabled = true;
_root.box2.button2.enabled = true;
_root.box3.button3.enabled = false;
}
}

button1 gets disabled, but then never get's enabled after that.... The other buttons don't even get disabled.... sheeeeeeesh
I've included the .fla, please help?????

Enabled Buttons Inside A Mc?
Hi All,

please how can I enabled, disabled, a group of buttons inside a movie clip.
Some thing like this:


Code:
_parent.fotos_mc.enabled = false;
However the code above doens't work, just if it was a button. But i have a group of buttons inside that mc.

Any tip?!

Thanks

HELP Enabled = False; For Only A Duration
Greetings! Its amazing how fast things get complicated in flash, and flash is just amazing period. I two buttons which are actually MCs, actually four, but i'm only dealing with two for now. Button A does something when pressed, and Button B tells Button A to 'put away' what it just did. This transition takes anywhere from 0-1.5 seconds. Everything works according to plan except I discovered that anyone can just press Button A again within that 0-1.5 seconds and mess things up.

I have been playing around with 'enabled' function so I tacked this onto Button B:


ActionScript Code:
_root.button_a.enabled = false;


That worked the way I wanted it to except I'm not sure how to enable it again. I would like to have it set itself back to enable = true; after the 1.5 second duration. Is this at all possible? I am new to AS and its terminology so if there is a better way, I am all ears of course.

Thank you very kindly.

-Zey

Buttons Enabled/disabled
Hi k-people!
Havin' a nice day? Good.
Here's the deal:

I have a menu with 6 different buttons.
Each of those buttons opens an external .swf.

I was trying to make the buttons be disabled when they had been clicked on. And I got that to work using this piece of code:

Code:
on (release) {
this.enabled = false;
}
But the thing is.. I also want them to be enabled again, when one of the other buttons have been clicked on.(of course)
So then I tried to add this below the other code:

Code:
on (releaseOutside) {
this.enabled = true;
}
But that didn't work.

So basicly, im asking what code I need. I've given each of the buttons instance names like "b1", "b2", "b3" and so forth..
That's if I need to include the instance names in some script.
If you could help me out that would be great.. if you can't, I'll have to kill you

-peace

Help Accordion Enabled Problem
Greetings!

Have you ever used the Accordion component?
I don't get why the enabled property doesn't seem to work. If it works, post a 2, 3 lines of code , cause I just don't get it

I've use the example from Help->Components Language Reference->Accordion:

import mx.core.View;
my_acc.createChild(View, "shippingAddress", {label: "Shipping Address"});
my_acc.createChild(View, "billingAddress", {label: "Billing Address"});
my_acc.createChild(View, "payment", {label: "Payment"});
my_acc.enabled = false;
trace(my_acc.enabled);//Output:false !!!!! ?!! !!

Of course I used an Accordion in the scene with the instance name of "my_acc".

I've tried the code only aproach( with the Accordion component in the library)...and still nothing:

import mx.core.View;
import mx.containers.Accordion;

var my_acc:Accordion = this.createClassObject(Accordion,"my_acc",0);
my_acc.createChild(View, "shippingAddress", {label: "Shipping Address"});
my_acc.createChild(View, "billingAddress", {label: "Billing Address"});
my_acc.createChild(View, "payment", {label: "Payment"});
my_acc.enabled = false;
trace(my_acc.enabled);//Output:false !!!!! ?!! !!

I don't get it! How can I disable it or stop it from getting user input
I've tried:

my_acc.getChildAt(0).enabled = false;

...and nothing !!!
I'm freakin' out! I just don't get it!
Need Help!

Button.enabled Question
Hi I´m having trouble with my buttons to enable them an when not to.
Have a var (loadswf) that changes value on (Press) and goes to and play frame 1.
In frame 1 I have the following code


ActionScript Code:
if (loadswf != "first") {    btnStart.enabled = false;} else {    btnStart.enabled = true;}

The movies starts with wht btnStart disabled but when pressing another button wich changes the value the button still stays disabled?
Any ideas

Copyright © 2005-08 www.BigResource.com, All rights reserved