ActionScript 2.0 :: Determine The Width Of A Button That Only Has A Hit State?
Jul 26, 2005there is a way to determine the width of a button that only has a hit state (no up, over or down states)? instance._width returns 0.
View 2 Repliesthere is a way to determine the width of a button that only has a hit state (no up, over or down states)? instance._width returns 0.
View 2 RepliesI need to add a rollover effect to the disabled state of a Spark button. This way, users can rollover the button and know why the button is disabled.I think I would have to override ButtonBase's getCurrentSkinState. Is there anyway to test if a mouse cursor is over a disabled button?
View 1 RepliesI'm using loadMovie to load a JPG to a MovieClip. As in ...
loadMovie("c:myimage.jpg", imageholder_mc);
What is the actionscript to determine the pixel width of the image loaded.
I just am looking over the CS4/3D methods and am a little bit stumped at this: globalToLocal3D... I am just trying to determine parameters to dynamically resize the width of myMc (once it is pushed back in z dimension - say to 2000) - I am basically using the globalToLocal3D method - yet the compiler is throwing errors - Error #2004: One of the parameters is invalid. here is the code that should be self explanatory (other than the fact that I am doing something wrong)...
[Code]....
Is their a way to determine the height and width of your flv f4v file after you dynamically load it?
Couldn't find any properties in the loader or netstreaminfo that I could grab the info from.
I have a menu with five nav buttons (atcually MovieClips). Each has three frame labels: "on", "stay", and "off". The rollover and rollout animations play flawlessly, but I'm at a loss as to how to give each button a sticky "active" state. I'd like the button to stay in it's active state until another button is clicked, then I would like it to play it's "off" animation. Each MC has this code:
[Code]...
I am creating a nav in flex that pulls in buttons dynamically from xml. THe problem i am having is setting the button width to the text width. currently the buttons are all the same width and if the text is larger then it just cuts off. I've tried a few ways of doing this:Setting button width to 100%On creation of the button try to set the width of the button to the text programmatically. Something like evt.target.width = evt.target.textWidth;
View 1 Repliesi'm trying to use if statements but can't get this thing to work i want to check if another button is visible on release of a button to determine what action to be taken.the 'gotoAndPlay("firstscene",1)' is just there as an outcome, will be changed later. anyway this is the code i've got on the button i'm pressing. blobyellow2 is an instance of a button blobyellow is it because it's an instance that it's not working?
[Code]...
edit: sorry forgot to put what's wrong with the code. it acts as though the statement is correct no matter if it is or isn't.
I want to save remotely (on a database) the state (visible columns, columns width and order) of a Flex3 DataGrid.For width and visibility I can simply save them by accessing each column attribute.. But for the order? Do I have to create the dataGrid dynamically?
View 2 Replieshow to keep a Movieclip Btn 'Over State' to stay in the over position until another button is clicked?
View 1 RepliesI have a series of buttons inside an array. I am trying to get the buttons so that once they are pressed, they remain in the over state. Which is a darker color than the up state. So that people know which button they have pressed. Is there an easy way to do this for buttons?
View 1 RepliesI have two buttons that are movie clips in Flash CS4 and when button 1 is on Over stage, I want the button 2 stop movie clip at the certain frame.
View 8 RepliesIs there a way of telling a MC button to have a hit state like a normal button? I have some text popping up away from my MC button that is included in the hit state. When I roll over the main button the text pops up. But also, when I roll over where the text pops up it also triggers the pop up animation.
View 2 RepliesI'm trying to make buttons that involve a character pointing to indicate interaction.When a button is interacted with (mouse over or down) the character's arm points to that particular button. I separated his body, so that it remains constant on the main stage, no matter which button is being interacted with.The problem is, when the user is not mousing over or clicking down on any button, the character has no arms (since only his body remains constant)!How do I resolve this?The only thing I thought of so far is if there's any way to create an up button state that includes the arm (right now I have nothing for mouse up) THAT ENDS when the next button is interacted with. Is that possible? If I put the arm in the up state (in addition to mouse over and down) it stays when the interaction is over, which poses a problem when the user interacts with the next button (the character ends up with double the arms since each button introduces a different set of arms pointing towards that particular button).
View 1 RepliesI have flash navigation on two pages (index.php & index2.php). I am attempting to have the button determine the current url.
If the current page is index2 it loads the appropriate movie If the current page is not index2 it goes to index2 and then loads the appropriate movie.
this is what I started with?
on (release) {
trace(_root._url);
if (_root.url == "index2.php") {
[Code].....
I would like the submenu to become black when clicked and so on. Here's some code (if you have the time the whole thing is included as an attachment). Greetings from Sweden.
Code:
function createSubMenu(num, nypos) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
[Code]....
There is event in spark Button - buttonDown. But how to determine the button up event?
View 1 RepliesRef: spark.components.ButtonBar. In the spark ButtonBar's mouseOver event, how do you determine which of the several buttons the mouse is hovering over? There is, of course, no selected index at this juncture. If it makes a difference, my ButtonBar is not defined in MXML but is instantiated in ActionScript and an ArrayList is assigned to the dataProvider property of my ButtonBar instance.
View 2 RepliesI'm writing an app where I want to know which, of an unspecified set of buttons, the user is clicking.The actual location of buttons determined by previous user actions, so I cant use information like mouseX.You can see from the code the way I'm attacking this - trying to access the button based on its position in the display list of a container. Unfortunately this has always led to type coercion errors 0 - AS can't see that e.target is a DisplayObject.se has solved this problem.
ActionScript Code:
import flash.display.DisplayObject;
import flash.display.Graphics;
[code].....
I have this bit of code, and it's not working as I expected. btnContainer is a VBox that contains a ton of buttons (toggle=true); and I want to reset them to un-toggled at a certain point.
for (var btn:Object in btnContainer.getChildren()){
if (btn.isPrototypeOf(mx.controls.Button)){
btn.selected = false;
}
}
With the above code, "btn" shows up as just the index during each iteration of the loop (0,1,2,3,...), and the conditional never evaluates to true.I also tried this:
for (var btn:Button in btnContainer.getChildren()){
btn.selected = false;
}
This works fine, except that there is also a label inside btnContainer; so it throws an error when trying to cast the label as a button.
I am using browseForSave() to give the user a chance to save a file before navigating back to a previous screen. As of now the cancel button on the save dialog just closes the save dialog. I want to see if the cancel button was clicked, and if so continue navigating back to the previous screen without saving. Right now the person has to save the file in order to move back. Below is the code I'm using.
[Code]...
I have a sub menu with two movie clip buttons, let's call them mc1 and mc2. They both have a MOUSE_OVER event and a MOUSE_OUT event. What I would like is that when mc1 is clicked it will stay in the over state and then if mc2 is clicked mc1 will go back to the out state while mc2 stays in the over state.What seems to be happening in my code is that the MOUSE_OUT event is overriding the MOUSE_DOWN event. So when I take the mouse off after I've clicked mc1 the over state goes away.
Here's my code thus far:
import flash.events.MouseEvent;
import flash.display.*
addEventListener(MouseEvent.MOUSE_OVER, mc1_over);
[code]....
how to make a button stay in its down state when it's clicked, and then go back to its up state when another button is clicked? I'm using buttons, not movie clips.
View 4 RepliesI have a rectangular shaped button. When someone rolls over it, I want a text bubble to appear to the side of that button. The problem is, the mouse thinks it's over the button even if it's over the side bubble which does not exist in the "Up" state. How can I get the cursor to only detect a button ONLY if it's over any part of the "Up" state and not the "Over" state (which because of the side bubble is larger than the original "Up" state.)
Here is a screenshot of the two button states.[URL]... Even if the cursor rolls over the "Over" bubble (and not the Up state), the Over state still shows up.
I have an interface that uses buttons to play videos. I would like it if, after you press a button, it stays in the 'down' state until the next button is pressed.
View 1 RepliesI've done the complex rollover tute where the animation plays and rewind when the mouse rolls on and off the button.What I'm trying to do is get button 1 to stay in the down state or clicked state until button 2 is clicked. Once button 2 is clicked, button 1 will play its rewind =true function.I can get the button to go to the down state when I click on it but the rollout function is overwriting the on release function as soon as I roll of the image.
View 5 Repliesi realize this probably a fairly simple question and also that i should have used movieclips for my buttons but i got lazy and used buttons for some of them
is there an easy way to make my button stay "on" after its clicked? i need something fairly easy that i can then go apply to a bunch of buttons. obviously it need it to turn off once another button is clicked as well.
Got a button with a gotoAndStop.When it gets to that frame I want to have a little bit o' script there to tell it to remain in that buttons over state.Should be simple, but I never did it with a button. I normally use MCs. Anyone know the syntax for it?
View 1 RepliesCurrently, when a button is in it's down-state, the AS disables the button. But since it needs to be active, i have to find a way to make the current 'down' button remain down during onRollOver and onRollOut.
button.onRollOver = function() {
this.over_holder._alpha = 100;
this.down_holder._alpha = 0;
[code]....
I created a button in flash. I gave it a different state for 'over' and 'down' - changing the color and scale respectively, so it looks depressed when you hit it.I then assigned an action to the button so that when it is 'hit' you are taken to another scene. However when you hit the button it goes to the scene but you lose out on the 'hit/depressed' part of the buttons state!? Why?
How do you keep the hit state intact with the button whilst simultaneously assign an action?I understant 'the action' is to go to another scene first, but can it not also show the 'hit state too?[URL]