ActionScript 2.0 :: Selected States For MovieClip Based Buttons
Jun 1, 2005
Lets say I have a nav with 4 items that are blue. If I click on one, I want it to turn red and stay red to reflect that Im looking at content in that area. If I click another nav item, the previous turns back to blue while the newly selected one turns red. I started to write a function and define a variable but I would like to see an example.
Below is the code I have for my buttons.I have 3 different swfs loading in once each corresponding button is selected (CLICK). I also have rollover and rollout or idle states. Now the dilemma: Once a button (mc) is selected (CLICK) I need it to remain in its rollover state. Once another button is selected I need the previously highlighted button to switch to idle state and the new button to be highlighted... Sounds like the most basic, simple, AS3 101 question, but alas I am hitting a wall. Based on my provided code what is the best option for this, an array with an active state on the timeline, a toggle with Boolean ect, ect...?
Code: var Hotspots:Loader = new Loader(); addChild(Hotspots); moreInfo_btn.alpha = .5; moreInfo_btn.buttonMode=true;
I am having trouble with a job I am doing at the moment which has an mc with buttons within it. I want it so that when I roll over the mc it tweens from a small version to a larger version, and on this mc there are some buttons. At the moment I can get the mc to move but the buttons remain inactive and also the rollover states on the buttons don't work. I have attached a simpler version of what I am trying to do to this post.
I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,
if(itemIndex == 0) this.currentState="selected";
this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,
I am creating a generic website that would have abstract MCs that would load jpg or TXT fields for the user interface to allow for fast updates to the site. The MCs that would make up the user interface would be empty and load things into it using XML or PHP later on. How would I create button states for the user interface MCs. I started creating a function for every MC button state but I thought there might be a more efficient way.
and is using URLRequest the way to link to pages with in a movie well the flash movie that is the site it's self?
/*---------------------------- THE START OF MY ACTION SCRIPT ------------------------------*/ var waywardLogo_mc:MovieClip = new MovieClip; var theCollection_mc:MovieClip = new MovieClip;
how to toggle on and off states on my buttons. Once a user clicked one it fades and disables ok as I want but i also want it to enable and fade back up again when they select another button. Below is my code:
PHP Code:
function GenerateShapes(shape_xml) { _global.shape_images = shape_xml.firstChild.childNodes; _global.disableShapeButtons = new Array();
As I am finally dipping my toe's into AS3 from years of AS2, I am having an issue for my menu buttons (which are within a movie clip) effecting the activation of movie clips that are featured on the main timeline.
I can get this to run how i want it when each menu button is on the main timeline (by using the 'the click to go to Frame and Play' code snippet)...but when these button are within a movie clip, I can't figure out where in the code i have to add the _parent. command ?
I have attached the .fla to see what I have done. I am keen to keep using the code snippets scripts.
when I select an item from my combobox, the selected value in shown in the textInput on the same row in the datagrid. Basically I need some some in the change handler of the combobox I suppose.
I'm trying to make buttons for my website that have sounds playing on them during the over states. But when you move the mouse off the button, the sound keeps playing. Run that mouse everywhere, the sounds are all playing, it's chaos. How do I fix a button so that the sound stops playing when the mouse moves off?
I have 5 buttons. Each of which have different movie clips in the up, over and roll out state. To be more specific, each button looks like a window. on the up state curtains cover the windows. on roll over the windows open. on roll out they close again.
What I want to do is ON PRESS force the button to go to its roll out state and then cut off all user activity from all the buttons until the transition to the next page takes place.
I have the following code to control the rollOver, rollOut and release states from my buttons (btn_company, btn_products, btn_services and btn_enquiry):
Code: for (var i in this) { if (this[i]._name.substr(0, 4) == "btn_") {[code]...
I also have 4 movieclips (title_company, title_products, title_services and title_enquiry) which I also want to control with those buttons. When btn_company is pressed, title_company should go to frame 2, When after that btn_products is pressed title-products should go to frame 2 and title-company should go back to frame one.
I am working on the multifile uploader, and want to set the upload directory based on a selected questionID (which is the directory name) in my datagrid. The code can be found here [URL] Something like this: I have set myQuestionID (the directory to upload to) so it is bindable (lines 136-137):
I know there are similar questions here that have been answered, but after trying to make sense of it, I still can't get this to work.Based on an array, I attach a number of MovieClips from the Library.On release they go to a certain frame, representing the "pressed" state of the button.The problem is, that I can't figure out how to reset the last pressed button back to it's original state...Here is the Actionscript code I have so far:
I'm starting to learn actionscript 3 programming and am in the process of trying to create a simple game but am having trouble getting flash to call up various movieclip states.I have a movieclip called "Player" and inside that movieclip, I have Player_Stand,Player_Hit, and Player_Walk...
While I can get the master movieclip to move, I can't get it to play the embedded movieclips when I change states. I tried a more advanced method that did work where you stick all of the animations in one movieclip and then manually tell flash to advance each frame using gotoAndStop in a loop, but it would be easier to just have seperate movieclips that I could just call from a master movieclip file. I've tried various methods to solve this including having all of the movieclips on screen and then changing their visibility but that didn't work either.
I have a project which is very straight forward however I'm having trouble figuring out the logic to get it started as well as the actionscript to get it working.THE PROJECT1. The user must choose one (only) out of about 100 buttons available on the page/frame.2. When the chosen button is released, the other buttons diasappear/turn invisible and become inactive3. A message appears within a speech bubble pointing to the selected button.PROBLEMS1. How do I make all the button disappear except the chosen one?2. How do I make the speech bubble point to the chosen button no matter which one they choose?MY LIMITED LOGIC SAYS1. I need to collect x and y values somehow to position the speech bubble2. Pass a variable to tell flash 'this is the chosen button'3. Tell flash to hide every button that isn't the chosen one using the variable
How do I code AS 3.0 to have multiple buttons on a frame selected sequentially? I have on frame with 4 buttons programmed to go to a specif frame when clicked. However, I want the buttons selected selected sequentially, so a user can not just click the last button and be finished with the CBT.
I am pretty new and I am trying to swap out swift files when the Buttons (Cabs & Sleeper) are selected but I cant figure out where to add the ".swf" file correctly, the current code I created is working but I am sure there is a better way to swap them, plus if I add more then 2 buttons the removechild will not work correctly (if a child by that name is not loaded) I think I have the right concept but I do not know how to make a variable that will swap the .swf rather than adding and removing the child.
Preloader hanging / freezing with "hiccups"I'm trying to do the following. I have a menu with 11 buttons and a xml. The user can select multiple buttons and depending on which buttons are selected it will be loaded images of the xml corresponding to the selected buttons.
The menu have to works as follows, for example, if I select the button 1, will be loaded X images, if I select the button 1 and 5, will be loaded X + Y images, if I select the button 1, 5 and 9 it will be loaded X + Y + Z images.
I'm trying to do the following. I have a menu with 11 buttons and a xml. The user can select multiple buttons and depending on which buttons are selected it will be loaded images of the xml corresponding to the selected buttons.
The menu have to works as follows, for example, if I select the button 1, will be loaded X images, if I select the button 1 and 5, will be loaded X + Y images, if I select the button 1, 5 and 9 it will be loaded X + Y + Z images.
I have 3 movieclips as windows on my stage. I would like to navigate between them to attach objects to those 3 movieclips. My question is: How can I tell flash which is a currently selected movieclip...? So that the to be attached object goes and sits in the currently selected widow/movieclip?
I have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function.[code]
'tf' is the instance name of the textfield inside a series of movieclips (_root.gm_mc.tfP1.tf, _root.gm_mc.tfP2.tf, .... _root.gm_mc.tfP99.tf). How do I make the selected movieclip active? and make the following onRelease action work only for the selected?
Im building a game, where the user has several images as movieclips. He can drag them to an area of the stage, and selecting them, he could rotate it. Does anybody knows some tutorials on hoe to start?
I have a menu with many sub menus. I need to change the color of the selected button and then move on to the sub menu. My menu is horizontal and now it's not obvious the path that you follow.
Is it possible? What I'm trying to do is enlarge the hitArea for a selected movieclip on my stage, but only onRollover. I have 5 MCs on my stage acting as buttons of sorts. onRollover of any of the clips, they grow in scale and I'd like the hitArea to do the same so they (MC and hitArea) are proportional.
Is there any way to disable a few columns for a particular row in flex datagrid?
I have a datagrid with about 10 or more columns, say for example a few column names are: Item Id, Item Name, Item Status and VerifiedState. Initially I want the column Verified State to be disabled.
Now When the value of the column, Item Status is Review Passed for a particular row, I want the column VerifiedState to be enabled and editable. Is that possible in Flex datagrid.