ActionScript 2.0 :: Building Menu Of Buttons With Dynamic Text On Top
Sep 17, 2004
I have managed to get data out from Mysql database. All it returns to me are:
1) Name of the button
2) Where it link to
3) Number of Buttons for the menu
So now, how can I build a menu of buttons such that I can display according to the database return on the number of buttons? I have already create a movieclip which is the image of a single button. With dynamic text on top of the button in the movieclip.
I just need to loop it thru the number of buttons and display the buttons on screen. But I can't seems to get it right. I have looked through the XML dynamic menu but it's not very similar to mine as I'm using PHP script to connect to the database.
I want to make a little app, .swf, that has a bunch of buttons on them - each button corresponds to a string of text...
So let's say, the buttons are marked as "Rd" "St" "Ln" etc...
When they click on the button, I want it to add that listing to the dynamic field box so it will look something like this
*User clicks on Rd button and "ROAD" pops up in the dynamic text box - User then clicks the "Ln" buttons, and then the dynamic text box changes to "ROAD/LANE"
User decides they don't want to use road, so they click on "Rd" button again, and the dynamic box reads "LANE" - user then wants to add "st" so they click on the corresponding button and now the text field reads "LANE//ROAD"
All I want to do is add text from my string to dynamic text field when I click dynamic buttons. What should the as code be for this? Here is my code. Right now I just have the click returning another shape.
I am building a menu and for each button of the menu, subbuttons apear beneath it along the menu. And I am having some problems. Each of the menu buttons has animations for rollOver and rollOut. What can I do so that when I move over the subbuttons the menu button won't start the rollOut animation. I have to extend the hit state. If I put the subbuttons in the same movie clip as the menu button, the animation would be bad because I am doing width, height, x and y tweenings with ActionScript and addind something the the clip would change these properties. Pls help.
Is it possible to extend the hit state of the menu button in some way ?
i have a problem with my flash menu. It's simple menu that contains one MC at start that works as button, u can edit size of the menu from external .txt file by changing the value of menu length. All that works fine , my problem is that every new duplicated mc contains dynamic text area as a label. Labels are also loaded from that .txt file , but that works only for the 1st mc because the newly created text areas in mc's dont have Instance Name set. How can i assign them from as?
So I'm trying to get cute again by building stacks of buttons dynamically, then labeling them from an external text file. The code I have so far is as follows:
[Code]...
But I keep getting the error message: Target not found: Target="undefined" Base="_level0" I'm not sure what this means.
I'm trying to make a dynamic menu. I load four buttons to the stage and applie code to each of the buttons. But it's only the last button loaded, that responds to onRollOver/onRollOut If I roll over the other buttons it's the last buttons that reacts all the time. I just can't see what's wrong. I'm sure it pretty simple. Here's the code:
I'm making a slide menu that loads a xml file and creates buttons dynamically. Another functionality it has a sliding menu also, and I can't stop it. Heres goes the zip file, which contains .fla and .xml files. What I want to do is when I put the mouse at the top of the mask, the menu stops on the first option, and when I put the mouse at the bottom, the menu stops on the last option. Is it possible? [URL]
I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
Code: //"this" is the button that was pressed; would return a string ending in //thumberMC_<number of whichever movieclip thumb was clicked> var: testString:String = this;
[code]....
Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).
I am making a dress up-like game but I am having problems with my buttons. I want to have 8 text buttons (hat, shirt, pants, etc) on the menu and when you click on the text button, the image of hat will appear on the figure, so I'm not asking drag and drop kind of effect.But I still want to be able to click on the hat and make it disapper,what's the actionscript I'll need to do this??
I'm trying to figure out where to get started on a menu like the one found at:There are several links, and as you rollover each of them, it changes the image above them. However, the image above them has links in it as well.I'm completely lost on where to get started as it seems like rolling over opens another page right above it.
I am using buttons with a dynamic textfield and a function to set the label for various different buttons:
public function setLabel(thisLabel:String) { visibleLabel.text = thisLabel; }
I set a label for each button:
btn_mc.button1.setLabel("2 | Al Sabkha Bus Station - Al Qusais Police Housing");
I have a dynamic textfield ... myText ... which I would like to use as a page title ... so once the button has been clicked, the dynamic textfield should update with the label of the button clicked.
My menu has 3 movieclip buttons, with text. I broke apart the text to change the color onMouseOver. Problem is the button only works when the mouse is pointed over the actual text, so it doesn't work properly, because the text is obviously very small. I can't put a "field" behind it, because it will become part of the MC, and thus will change color. Here's the example: [URL]
HOW do I go about doing it?Ive tried...buttonon "over" create to movie clipinside movie clip have my animations and sublink buttonsit works fine, but there's one problem, The hit area of the main button HAS to cover the hidden sublinks, so even if you scrolled your mouse over the bottom of the button (in the invisible area) it will still show since its in the hit area).How can I create a simple nav drop down? I seriously have went through almost all tutorials, both video and text, and nothing has worked! I am using Actionscript 3, or whatever the tutorial says to use.edit: Here is something I'm working on. Its a button, and on the rollover it creates the animation. Obviously it doesnt work, because you cant have a button inside a button, so I don't know the actionscript to do this.
What I have so far is all my menu items get added to an array and they have a start y property. They are all evenly placed apart.I'm taking this is little steps so as a start I wanted to click on a menu item and just move it to the center of the menu and reposition the others.I have the mid point stored.So when I click the item I find out what index in the array the item is at and I find how many index positions away the item with the start y I want to move to is.I then go through every item in the array and tell it to look that many positions away, get the startY of the item there, and set it as its destination Y. In theory it seems sound to me but it completey does not work.the code I have so far is like this
Code: private function rearrangeStartY($menuitem:MenuItem):void {
I'm building a menu with action script, the menu has an interval, so the items follow after each other. This is not a real problem. But the submenu is. I want to build it the same way, with the interval. But the menu array contains, some years, and with a loop a go trough this array and flash builds it with the items of the array. The submenu array, contains the quantity of the year, so the quantity of subbuttons.. But i can't fix it to use the number in the array as quantity of subitems. here is the code:
I'm building a menu with action script, the menu has an interval, so the items follow after each other. This is not a real problem. But the submenu is. I want to build it the same way, with the interval. But the menu array contains, some years, and with a loop a go trough this array and flash builds it with the items of the array.
The submenu array, contains the quantity of the year, so the quantity of subbuttons.. But i can't fix it to use the number in the array as quantity of subitems..
Link to site: [URL] I've been trying to create a flash website menu that updates the menu text via an xml file. The problem I'm experiencing is that when I update the dynamic text in the menu, it doesn't seem to go through. I know I am referencing the dynamic text correctly as when I run the swf for the first time, I briefly see the correct text for about half-a-second before it is replaced by the default dynamic text. There is something that is overwriting the new text with the default values but I cannot see what is causing it.
I am changing the dynamic menu text in _root although the dynamic text exists in nested movie clips i.e. '_main.menu_mc.menu_panel_1.menu_button_1_1.menu_b utton_text'.
I've been trying to create a flash website menu that updates the menu text via an xml file. The problem I'm experiencing is that when I update the dynamic text in the menu, it doesn't seem to go through.I know I am referencing the dynamic text correctly as when I run the swf for the first time, I briefly see the correct text for about half-a-second before it is replaced by the default dynamic text. There is something that is overwriting the new text with the default values but I cannot see what is causing it.I am changing the dynamic menu text in _root although the dynamic text exists in nested movie clips i.e.'_main.menu_mc.menu_panel_1.menu_button_1_1.menu_b utton_text'.The code in _root is:
I've been trying to create a flash website menu that updates the menu text via an xml file. The problem I'm experiencing is that when I update the dynamic text in the menu, it doesn't seem to go through.I know I am referencing the dynamic text correctly as when I run the swf for the first time, I briefly see the correct text for about half-a-second before it is replaced by the default dynamic text. There is something that is overwriting the new text with the default values but I cannot see what is causing it.I am changing the dynamic menu text in _root although the dynamic text exists in nested movie clips .e.'_main.menu_mc.menu_panel_1.menu_button_1_1.menu_b utton_text'.The code in _root is:
I have created a slider menu that moves when the arrows are clicked on either side. The images for this menu are loading dynamically from an xml file onto a 'container' in my fla.
Code is :
import com.greensock.*; import com.greensock.easing.*; var xml:XML; var images:Array = new Array();
I developed a simple slide menu, I create an animation of the menu (I grouped the buttons).All works fine, but when I try to use dynamic text to put the options using actionscript the text does not show.
I am working on a new site, and in the site items from the library are brought on to and taken off the main stage through a handful of functions in the document class. I also have a main menu class that is responsible for building and adding menu items. The way it is built currently, these menu items must somehow reach into the document class and call the functions I created earlier, but I am unsure how to do this. Most things I find on how to call a parents method end with the person saying if it built correctly you shouldn't be doing this at all.
I'm building a menu based on the abount of images in an XML file. I've already got the images to load individually sequecially but now I want a menu built by duplicate movieclip. I can duplicate a movie but I can't populate the textfield in the clip with a number. plus I don't know how I'm going to get it to load the individual image.
I'm trying to create a menu system and I've created a "Button" with a dynamic text field on it. I'd like to set the text of the button when I add it to the stage but I'm having some troubles. Does this work differently then a dynamic text field on a movie clip? I've done it successfully on a movie clip.
var test; test = new menu_item(); stage.addChild(test); test.x = 610; test.y = 100; test.menuText.text = "Hello World";
I get this error message in my output window... TypeError: Error #1010: A term is undefined and has no properties. at Main$iinit()
I have created a slider menu that moves when the arrows are clicked on either side. The images for this menu are loading dynamically from an xml file onto a 'container' in my fla. I need desperately to also be able to add text underneath those pics.
Code is : import com.greensock.*; import com.greensock.easing.*; var xml: XML; var images:Array = new Array(); var totalImages:Number; [Code] .....
I'm a Flash MX action scripting newbie. I'm trying to create a dynamic drop down menu system that reads a text file to create the items listed in the menu. I've been reading tutorials and trying to break down source fla files to understand how things work. I'm stuck on what the following block of code means.Would it be possible for someone to break down the following code for me? It references menudata.txt to create the drop down menu. I can successfully modify menu.data.txt to create more menus and change the titles in each button, but creating sub-nav is totally kicking me in the arse.
I have been using senocular's excellent 'squirrel finder' tutorial try and create a fairly simple xml-fed flash interface. Basically, i need to have a list of architectural projects in a menu, and when each one is clicked the project info is loaded into a dynamic text field and a series of maybe 2 or 3 images are also sent to movie clips on the stageThis is my xml file: