Actionscript 3 :: Keep Element Grayed Out Unless A Conditional Is Met?
Apr 3, 2011
I'm in the process of designing a Flash application, and it requires either two or three pieces of data from the user.The third data element is only relevant if one of the other elements has changed from the default value.In order to prevent the user from inputting information that would skew the calculations based on the input, how can I gray out the text input box if the default conditional is unchanged? I could embed a conditional to ignore the input from that particular box, but I know that some users will fill in all data fields regardless of on-screen instructions.
I am finding that my flash object is not displaying properly in preview or after export. I basically have a long restaurant menu that is 748 wide by 2039 high full of static text. When I preview/export only the top 3/4 of the text are displayed, the lower end portion is blank. This text field is layered on top of a background jpg, which lies of top of the stage. I've made sure the stage's dimension covers exactly everything. My footer shows up properly, as well as the stage itself. Its just the lower portion of texts that is the problem.I should also mention that the height selection is grayed out with this text field I have. I tried creating a new smaller text field but again, its grayed out.
I dont know whats up with this... but all of a sudden today, in my flash cs4 (mac and PC versions) When i go to open a fla in flash to work on it, i select a text box... in the properties window under position and size --- HIEGHT-(selection hieght) value is grayed out... I opened fla's that i had don before but this also now affects them as well. I tried opening on my PC .. now it does the same thing. Every file i open now.. when i got to the properties of a text box ... the height values are grayed out. I am using Palatino roman font... in a simple text box. Position and size:
I have two vector graphics I imported to my stage and want to do a shape tween between them. But shape tween is grayed out. The images are imported Illustrator EPS's. I attached two screenshots.
I've been playing with Wondershare Democreator for a few days now and it's been working very well. But today for the first time I tried putting a demo on a website. [URL] is an example of the problem I'm having. The above example works immediately in all browsers except IE. When I load that page for the first time in IE the play icon in the centre won't work and the play button at the bottom is greyed out. If I refresh the page things work find and work form then on, but if I clear my cookies and cache the same thing happens again. Obviously it's an unacceptable situation to be telling the viewer to refresh if using IE. It has to work first time. The embed page used is the one created by the software. I've contacted the creators but who knows when they'll get back to me.
I made a simple animation with motion tween, and hope to copy the animation. I selected all the frames, and right click, but the copy motion option is gray!!!!
I've imported a gif file into flash, traced it into the bitmap, made 24 symbols from 25 I wanted, I've distributed them into timeline, made a simple animation from few layers just for fun, when I made a new symbol it was from the first frame, only there was possible to see all graphic and select a new symbol, however now when I click on the first frame the last part of graphics that I want to convert to symbol is grey and I'm not able to select it (picture 4, the small grey stains), however with a selection tool it is possible to change a shape of the "stain". Other miracle I don't understand is the magenta square in left up corner, picture3 (it occurs only from 2nd frame), in library no symbol has this square.
Why are the scale x and y options grayed out on the motion editor? I tried editing width and height (W&H) in the "properties panel" under "position and size" and all that does is move the position my object diagonally for some reason, not scale the size. Also, when i do this, the Width number does not change, but the x and y position numbers above it change. Strange!
I have a movie clip, and need to to a 180 3D rotation on it, however when I select it and go to transfrom - 3D Rotation, the value fields are grayed out.
for one reason or another, my brush tool only allows me to select color and smoothing. Stroke, style, scale, and everything else is grayed out and will not let me change it.
I know that there is no such function as getElementByName in Flex but I also now that you can do this["object_id"] to get the element of the application u're in.What about getting an element inside another element?I've tried making element["id"] ? But in my try-catch it always runs the "catch" part..how do I get an element inside another element just having it's id in dynamically created string form?
I have flash where there is a link for song download. And, at the bottom of the flash I've a count, loaded thorugh flash vars which should increment everytime donload button is hit. Please let me know what approach should i take to do that. can i call a Java method on donload button which will insert a row in the table and and then get the count and render it to the count variable in my flash?
May be this extremely confusing. Here is a very similar example on how it is done. This is actually very similar to what i want to do. [URL] on this link there is count below which increments you hit the download button.
I've built a rather robust tooltip class recently that attaches and draws a single tooltip sprite to the root, then uses MOUSE_OVER to detect when it is over a tooltippable object, and shows the appropriate tooltip text. At the moment, I'm ensuring that any elements in my application which wants to take advantage of showing tooltips implement the ITooltippable interface, and expose a public getter, get tooltip().
Basically I have 14 text boxes, each box draws its content from an external txt file. Next to each text box is a button. I want the button to be either visible=true or visible=false depending on weather or not the text box has content or is "undefined" Here is what I have so far, and it's not working:[code] I would like a FOR loop to just run through the variables and check to see if any of them are undefined. if it is, then make the correct send button invisible.
I've got a navigation menu that relies on this following script to control what state appears when the relevant section loads.
[Code]...
I'm trying to figure out what I need to add to get the navigation buttons to be greyed out (which is frame 1 of 'navi' with "none" label) because the section doesn't have any following pages, it's just an address page.You can see the full animation at [URL] the Contact Us section. presume it's another 'else if' command but I'm a little confused what to do. Ned, if you see this, I did try and solve it myself but I came up against the knowledge block:-)
this["nodeValue"+i] = new TextField(); (surely in dynamic class )
then I want to change instance name of that element.when I trace this["nodeValue"+i].name.I got a different name for that element ! f ex : instance8 .how can I get "nodeValue"+i from my element and change that .is it read only ? I want to swap tow element's instance name !
for example : this["nodeValue"+i] to this["nodeValue"+i+1]
I am having a problem with my drop traget. I have the ability to drop and duplicate multiple objects on a stage. I have a clip set up (canvas) which is used for if someone drops objects onto this it duplicates the dragged clip.
However the problem I am having is that if someone tries to drop an element on top of an already drop/duplicated element, it wont duplicate the new clip. Its like it thinks that the dragged clip is not over the canvas.
So I'm not that familiar with using conditional statements yet, and I'm trying to get my head around it. I know what I need it to do, I'm just not sure of the correct syntax.I basically want a statement that says:
if( movieClip1 == frame 10) { then play movieClip2
I have FLV files that continue playing when I leave the frame that they are on. I can stop the playing FLV by putting this code on the following frame:
if (demo.playing) { demo.stop();}
Where .demo is the name of the instance of the .flv component.
Here is the problem - I have many frames with many flvs, and when I tell flash to stop multiple FLVs, for instance:
if (demo.playing) { demo.stop();} if (demo2.playing) { demo2.stop();}
I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference
As far as I know, flash is telling me that since the instance of "demo2" has not started playing yet (ex. the user only went to the page with the "demo" flv, but not the "demo2" flv yet) that flash has no idea what demo2 is yet. I thought using a conditional statement would remedy this, but I suppose the .swf can't stop playing something it does not yet know exists.
Is there any way I can introduce all of the flv's at the beginning of the file, yet not have them play and not have flash "forget" about them so that I can stop them using the code above? Or is there a way to have the conditional statement not error in the event that the referenced instance has not yet been "introduced"?
I really wish they would have added an "exit frame" command in AS 3.0...
I'm trying to make a gallery loaded from external files, and I try to not use ready packages or swfs, so I wrote a code. I have many images in a folder and a xmlListfile of this images, and I accomplished to load them one by one, but when the list reach to end in both ways (start or end), Button function for the next images continue to work, I treid to solve to problem with a conditional in function but it didn't help.
The code is:
ActionScript Code: var i:uint = 0 var imageLoader:Loader; var xml:XML;
It's a little more complex than that, actually. Inside a function, which is called by a Timer Event, I have many conditional statements based on CurrentCount of my Timer. Nested within these conditionals are more conditionals. <<<I know it's amateur programming, and I'm sure there are much more elegant ways, but I'm just learning (via attempting a difficult challenge).>>> One way I'm trying to control all these conditionals is via a random number, from 1 to 3. My problem is that after generating the number within one "if (currentCount == )" statement, the variable is no longer available to be used by the next "if (currentCount ==)" statement. Is this some terrible side effect of using the Timer class??
Code: var timerMain:Timer = new Timer(900, 25) timerMain.addEventListener(TimerEvent.TIMER, takeTurn); timerMain.start(); function takeTurn(e:TimerEvent):int { if (timerMain.currentCount == 4) { [Code] .....
In the code below how can I use the movieclip in the conditional statement? This is simplified, there is lots more going on but the basic issue is shown. I want to say if currently dragged mc is dot1_mc do the copyDragTo35 function
PHP Code: var item:MovieClip; //add event listeners to all dots kite_mc.dot1_mc.addEventListener(MouseEvent.MOUSE_DOWN, onItemDragStart); kite_mc.dot2_mc.addEventListener(MouseEvent.MOUSE_DOWN, onItemDragStart); function onItemDragStart( e:MouseEvent ):void {
When use the full path name and the identifier of a movie clip, my conditional statement works fine. However, when I swap the identifier out with "this", it no longer works. This script is contained within the movie clip I am trying to reference. I have found that, "this" works fine by itself on the timeline. It just stops working when I place it within a conditional statement.
Here is my script: function functionOne() { randomX = 550*Math.random(); randomY = 400*Math.random(); } functionOneInterval = setInterval(functionOne, 1000); function functionTwo() { [Code] .....
The reason I am trying to use "this" instead of the identifier name is because the movie clip it is referencing will be duplicated. This script here generates a random destination point for an enemy spaceship and tells it to constantly move to the changing points. This script is contained within the enemy spaceship movieclip, and I am planning on duplicating several of them at once.
How would you stop an FLV using a conditional statement where the condition is if the FLV is playing?
I'm using AS 3.0. My best shot was this:
if (demo.flv == play){ demo.flv.stop(); }
I'm sure the "== play" part is wrong, but I cannot find the correct code that checks to see if the video is currently playing.
My flv component does have an instance name of "demo". The command "demo.flv.stop(); works fine as a non-conditional, but the flv is not always playing with my navigation set-up when you land on the frame with the code, so I need a conditional.
I'm trying to make a button that if you hit it 4 times it plays a movie clip. On the 5th hit- I want it to play a different movie clip. After the 5th hit- it resets itself and the process would start all over again. The script is all in one keyframe and the movie clips are being played with functions.
playButton_btn.addEventListener(MouseEvent.CLICK, goButton1); function goButton1(evt:MouseEvent):void{ runningMan_mc.gotoAndPlay(2);}
I want to write AS3 code that has 2 variables; one that acts on odd numbers and the other that acts on even numbers entered into a text field ?(sorry I'm not making much sense here! Will explain the context further)I'd like to use an XML calendar in my Flash project that shows the odd or even dates in the calendar depending on what number you enter in a field being either an odd or even number. (This is based on ACT Water Restrictions odd and even watering restrictions)It means that if your street number is an odd number you can use water as per restrictions when the date also is an odd number. Similarly, if your street number is an even number you can water as per restrictions when the date also is an even number. You're probably familiar with this system.
The context is for my Adult Migrant students to understand the concept of our water restrictions here which is governed by this odd and even system.So what I'm doing to do next is buy a cheap XML calendar online which I can adapt for my project but I'm not sure whether I should be approching this code problem with an if/else statement to get the results or something else?how to write the code!!
if my number I enter is an even number then display (in an XML calendar) even days else if my number I enter is odd then display (tin an XML calendar) odd days