SEARCH YOUR SOLUTION HERE  

menu button with a TypeError: Error #1009

Hi everybody,

I'm working on a Flash CS4 presentation which has a menu page as well as a navigation bar (with a timer) that appears for 5 seconds and then disappears until the user moves the mouse again.

The play and stop buttons are working fine but when I click on the menu button it takes me back to the menu page but then I get this Flash error message:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ADAGIO_3_fla::MainTimeline/showmenu()

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ADAGIO_3_fla::MainTimeline/hidemenu()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()


I don't know if it's an issue with the timer or something else that's missing.

I posted the fla here if anyone can check it out.

http://rapidshare.com/files/345010518/ADAGIO_3test.fla


For now only the 3rd menu button is active until I'm finished.

Posted On: Thursday 25th of October 2012 10:13:18 PM Total Views:  439
View Complete with Replies




Related Messages:

CS3 Need help to make a menu with images   (161 Views)
I'm making a website and I want to make a menu like the one here:http://www.dallascowboys.com/ the flash menu with the pictures zooming in and each one has a hyperlink. I'm trying to implement it into a site I am making: http://www.flickr.com/photos/4345720...26919/sizes/l/ Thank you
fly out menu (sorta) help   (129 Views)
I need some major assistance. I'm at my end. I've been trying to take tutorials after tutorials only to have error after error, nothing works. Probably the main reason is most tutorials do not list if they are AS1,2, or 3 I'm currently trying to make a fly out type thing in actionscript 2 If you look at the pic I provided everything under the patients column will be buttons. right now only TBI is a button. What I want to do; is be able to click that button, and have another movie clip (the blue square with writing in the library) show up over the desk area. Then do the same thing with the other 2 buttons. I was thinking about just doing an alpha tween on the movies to show up once I click the button. Right now I'm working with 4 layers a background, a button layer, the board with the names on it is a layer and I have my movie clip layer. Could someone please tell me how in the world I can code this. I have 0 knowledge of scripting. or perhaps direct me to a tutorial along these lines that actually works on AS2.
[CS3 - AS2] Need help with XML Scrollable Dropdown menu thing   (146 Views)
, I'm kind of new to Flash (and by new, I mean not an expert), I know some things but my knowledge is fragmented at best. I'm trying to create a combobox that is populated by names from an XML file, and when clicked on fills a series of textboxes with other information from the XML. The biggest problem is that I need to retrofit it so the code works off a specific XML file. It's structured like this: Code: This is the Action Script code I use to populate the textboxes: Code: PopulateLists = function(xml_array){ { var detail = xml_array[0].attributes; _root.infoName.text += detail.infoname; _root.info1.text += detail.info1; _root.info2.text += detail.info2; _root.info3.text += detail.info3; } } var details_array; var Detailxml = new XML(); Detailxml.ignoreWhite = true; Detailxml.onLoad = function(success){ if (success){ var Detailxml = this.firstChild; details_array = Detailxml.childNodes; PopulateLists(details_array); }else trace("Error loading XML file."); } Detailxml.load("C:/XML/Details.xml"); This code has worked for me so far and does technically work for that I want to use it for. I know changing xml_array[0] to an other number changes the row it reads from, so what I want to do is make it so it's a variable that's filled by the list. So the first option in the list would be "example0" and when clicked would run the code with xml_array as 0, the next row would be "example1" with xml_array as 1, ect. It needs to be done in such a way where you can add as many entries into the XML as you want. How can I do this I know I'm in over my head but I've already got everything else in my project done except this and I can't find any tutorials or anything on Google that I can get my head around or will do what I want it to (so far always both). If anyone can help me, it'd be REALLY appreciated. FWI, in case you haven't guessed, the XML and code I posted isn't "exactly" what I'm using, but it works exactly the same. *edited post because I should have said combobox*
[CS3] Drop down menu   (121 Views)
, I am trying to make a drop down menu similar to the one on IBM's website ( http://www.ibm.com/ ). I know how to link the buttons and such to the different pages, my problem is how do I add the 'drop down' component to the menu
[CS3] Show and hide submenu items   (134 Views)
, I am really new to flash, so please be gentle with me. I am trying to setup a submenu within a flash movie. It's pretty basic, all I need is to show/hide a list of submenu buttons when the mouse is hovered over the appropriate main menu item or any of the currently displayed submenu items. The submenu would hide once the mouse is moved a way. I've been googling this thinking that's it's a pretty common function but I can't seem to find any relevant information. Can anyone point me in the right direction Tutorials, example flash movies, anything
Draggable menu problem   (135 Views)
Hi I am trying to build a drop down menu that is draggable - independent of other draggable symbols. 1. If I apply the drag script to the menu movie - the buttons become inactive. 2. If I apply the drag script to the menu heading as a button - it also drags every other symbol on the same frame. 3. If I apply the drag script to the menu heading as a movie - it drags the heading only and leaves the menu buttons behind. Any ideas on how I can do this! Many super
vertical menu   (125 Views)
i have a menu ive made that is a bunch of categories stacked on top of each other and when you roll over one it opens to reveal more options which allow you to travel across a page well in order to keep the menu open so you can roll over the submuenu buttons i had to group all of the sub button movieclips and the main movieclip into one movieclip now my links dont work so the question is how do i get a link on a movieclip inside of a movieclip to work
[CS3] Creating a menu   (133 Views)
I've been trying to make a system of menus with Flash for the menu on my site. I want my menus (and submenus) to fade in when I mouse over their "parent" directory, and fade out when I take my mouse off of. I figured out how to make a menu fade in and out using ActionScript 2. However, I cannot figure out how to "extend", if you will, the hit box for the button.
using xml drop down menu from flashmymind   (138 Views)
Hi team, I have got this example off flashmymind -sorry not allowed to use the link Google "advanced xml drop down menu as3" - its the one with the orange buttons Looks fantastic, but now my question is, if it is all produced through script, how do I put a listener on each button to react when they get clicked Cheers sub //Import TweenMax for animation import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; TweenPlugin.activate([GlowFilterPlugin]); //Save menu item's height to a constant variable const ITEM_HEIGHT:Number = 50; //Save the path to the XML file var xmlPath:String = "flash_menu.xml"; //The XML data will be inserted into this variable var xml:XML; //Set the floor (= y coordinate) for the menu items var floor:Number = stage.stageHeight-50; //We want to know which menu array is currently selected var selectedMenu:Array; //We want to keep track how many menus have been created var menuCounter:uint = 0; // Load the XML file var loader = new URLLoader(); loader.load(new URLRequest(xmlPath)); loader.addEventListener(Event.COMPLETE, xmlLoaded); //This function is called when the XML file is loaded function xmlLoaded(e:Event):void { //Make sure we're not working with a null loader if ((e.target as URLLoader) != null ) { //Insert the loaded data to our XML variable xml = new XML(loader.data); //Ignore white space xml.ignoreWhitespace = true; //Call the function that creates the whole menu createMenus(); } } //This function creates the menus function createMenus():void { //Loop through the menus found in the XML file for each (var menu:XML in xml.menu) { //We create a menu for each menu found in the xml. //We pass the "menu" xml data as a parameter to the function. var menuItems:Array = createMenu(menu); //Position the menu items that are in the menuItems for (var i= 0; i< menuItems.length; i++) { //Set the x and y coordinates menuItems[i].y = floor; menuItems[i].x = -30 + menuCounter * 180; //Add the item to stage addChild(menuItems[i]); } } } //This function creates a single menu (= one vertical menu). //It returns all the menu items which belong to the created menu. function createMenu(menu:XML):Array { //Create an array which contains all the items in this menu var menuItems:Array = new Array(); //Loop through the items found in the menu for each (var item:XML in menu.item) { //Create a new menu item var menuItem:MenuItem = new MenuItem(); //Set the item text menuItem.menuText.text = item.toString(); //Set the menuItem to have no mouseChildres menuItem.mouseChildren = false; //Add the item to the menuArray menuItems.push(menuItem); } //We also need to create the main MenuItem for the menu var mainItem:MenuItem = new MenuItem(); //Set the mainItem to have no mouseChildren mainItem.mouseChildren = false; //Add the main item to menuArray menuItems.push(mainItem); //Save the array to which this mainItem belongs to. //We need this in the animation later on. mainItem.belongsToMenu = menuItems; //Set the "id" attribute to be the main item's text mainItem.menuText.text = menu. @ id; //Add CLICK listener for the mainItem mainItem.addEventListener(MouseEvent.CLICK, mainItemClicked); //Update the menuCounter since we just created a new menu menuCounter++; //Return the menuArray that contains all the items in this menu return menuItems; } //This function is called when a menu's mainItem is clicked function mainItemClicked(e:Event):void { //Animate the previous menu down if there is one if (selectedMenu) { for (var i =0; i< selectedMenu.length-1; i++) { TweenMax.to(selectedMenu[i], 0.5 , {y:floor, glowFilter:{color:0x324df, alpha:0, blurX:0, blurY:0}}); } } //Get the menu where the mainItem is located var clickedMenu:Array = e.target.belongsToMenu; //Set the clickedMenu to be our selectedMenu selectedMenu = clickedMenu; //Loop through the items except for the last one which is the mainItem. //We don't animate the mainItem for (var j =0; j< selectedMenu.length-1; j++) { //Save the item to a local variable var item = selectedMenu[j]; //Calcute the target y coordinate for the item. var targetY:Number = floor - ITEM_HEIGHT*2.2*(1 + j); //Tween an item up. TweenMax.to(item, 0.5 , {y:targetY, glowFilter:{color:0xffffff, alpha:1, blurX:20, blurY:20}}); }
Create an lso to stop my header menu from refreshing   (185 Views)
This is a question that a lot of people have asked, but I have yet to see any answers. I need some assistance with coding out how to make a local shared object remember the users last frame, so that when they click the next flash link button for a different page, the movie doesn't default to the beginning. I've tried this code, but it's all wrong - I don't even know if it's truly AS 3.0 or 2.0 var so:SharedObject so = SharedObject.getLocal("remember"); // if the user is undefined play from the start. if (so.data.user == undefined) { gotoAndPlay(1); } else { // if the user is defined then play from the last frame they were on this.user = so.data.user; this.gotoAndPlay(so.data.frame); } // this creates the rememberme(); function to save the frame number. function rememberme() { so.data.frame = this._currentFrame; so.data.user = "User"; }
XML menu that creates another menu   (170 Views)
i'm having a lot of trouble trying to figure something ou. The point is this, i have a products application that loads all the info from XML. The objective is to generate a image based menu that when an element is clicked is going to load css formatted text and a set of thumbnails. That set of thumbnails (that are specific from each product) are supposed to load the full images. My problem is that i'm ok until loading the thumbnails but i can't get to opening the full images when the thumbnail is clicked. XML Structure HTML Code: img/boton1.jpg Cliente 1 "titulo2">Este es el subtitulo del texto Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.]]> wallace_and_gromit.jpg AS3 Code ActionScript Code: import com.greensock.*; import com.greensock.plugins.*; TweenPlugin.activate([GlowFilterPlugin]);//se activa el plugin de brillo para los elementos del menu var i:Number; var j:Number; var numeroActual:Number; var elementosTotales:Number; var galeriaNumber:Number; var clientesXML:XML; var imageHolder:MovieClip = new MovieClip();//holds the full image var galeriaHolder:MovieClip = new MovieClip();//holds the thumbnails of each product var clientesHolder:MovieClip;//holds the main menu var clientesLoader = new URLLoader(); var clientesURL:URLRequest = new URLRequest("clientes.xml"); var cssLoader:URLLoader = new URLLoader(); var cssURL:URLRequest = new URLRequest("Estilos.css"); var estiloCSS:StyleSheet = new StyleSheet(); //THE NEXT IS COMENTED BECAUSE IS NOT IN USE RIGHT NOW //imageHolder.x = imageHolder.y = 100; //imageHolder.alpha = 0; //LOAD AND PROCESS CSS cssLoader.load(cssURL); cssLoader.addEventListener(Event.COMPLETE, cssLoadComplete); function cssLoadComplete(event:Event):void{ estiloCSS.parseCSS(cssLoader.data); cuerpo.styleSheet = estiloCSS; clientesLoader.load(clientesURL);//load the xml once the css is loaded } //GO BACK BUTTON// botonVolver.buttonMode = true; botonVolver.visible = false; botonVolver.alpha = 0; rect.alpha = 0; cuerpo.alpha = 0; cuerpo.blendMode = BlendMode.LAYER; barraScroll.alpha = 0; botonVolver.addEventListener(MouseEvent.CLICK, volverClick); function volverClick(e:MouseEvent):void{ botonVolver.visible = false; TweenLite.to(rect, 0.5, {alpha:0}); TweenLite.to(cuerpo, 0.5, {alpha:0}); TweenLite.to(barraScroll, 0.5, {alpha:0, onComplete:textoTweenCompleteOut}); borrarGaleria(); //TweenLite.to(imageHolder, 0.5, {alpha:0, onComplete:imageHolderComplete});//NOT NEEDED YET } function textoTweenCompleteOut():void{ clientesHolder.mouseChildren = true; TweenLite.to(clientesHolder, 0.5, {scaleX:1, scaleY:1, alpha:1}); } /*function imageHolderComplete():void{ imageHolder.removeChildAt(0); }*/ //GO BACK BUTTON// /////////////////////////////////////////////////////////////////////////// //LOAD XML FILE// //clientesLoader.load(clientesURL); clientesLoader.addEventListener(Event.COMPLETE, clientesLoadComplete); function clientesLoadComplete(e:Event):void{ clientesXML = new XML(e.target.data); elementosTotales = clientesXML.cliente.length(); // trace(elementosTotales); cargarBoton();//FUNCTION THAT LOADS EACH MAIN MENU ELEMENT cargarMenu();//FUNCTION THAT LOADS THE MAIN MENU IN THE STAGE } //LOAD XML FILE// /////////////////////////////////////////////////////////////////////////// //MAIN MENU CREATION// function cargarBoton():void{//load the main menu and assign a name to it for (i = 0; i < elementosTotales; i++) { var botonURL:URLRequest = new URLRequest(clientesXML.cliente[i].boton); var botonLoader = new Loader(); botonLoader.load(botonURL); botonLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, botonLoaded);//function to put the menu element into the menu holder botonLoader.name = i; botonLoader.y = i * 130; // trace(botonLoader.name);//check the name of every main menu item } } //add the main menu container into the stage function cargarMenu():void{ clientesHolder = new MovieClip(); clientesHolder.x = clientesHolder.y = 50; addChild(clientesHolder); } //add every menu item to the container function botonLoaded(e:Event):void{ var botonLoader:Loader = Loader(e.target.loader); var botonHolder:BotonMC = new BotonMC(); botonHolder.addChild(botonLoader); botonHolder.buttonMode = true; botonHolder.addEventListener(MouseEvent.ROLL_OVER, botonOver); botonHolder.addEventListener(MouseEvent.ROLL_OUT, botonOut); botonHolder.addEventListener(MouseEvent.CLICK, botonClick); clientesHolder.addChild(botonHolder); } //MAIN MENU CREATION// /////////////////////////////////////////////////////////////////////////// //MAIN MENU FUNCTIONS// function botonOver(e:MouseEvent):void{ var botonHolder:BotonMC = e.target as BotonMC; TweenLite.to(botonHolder, 0.5, {glowFilter:{color:0xffffff, alpha:1, blurX:15, blurY:15}}); } function botonOut(e:MouseEvent):void{ var botonHolder:BotonMC = e.target as BotonMC; TweenLite.to(botonHolder, 0.5, {glowFilter:{color:0xffffff, alpha:0, blurX:15, blurY:15}}); } function botonClick(e:MouseEvent):void{ numeroActual = parseInt(e.target.name); rect.texto.htmlText = clientesXML.cliente[numeroActual].titulo; cuerpo.htmlText = clientesXML.cliente[numeroActual].texto; barraScroll.update(); galeriaNumber = clientesXML.cliente[numeroActual].galeria.img.length(); TweenLite.to(clientesHolder, 0.5, {scaleX:0.2, scaleY:0.2, alpha:0.5, onComplete:botonComplete}); clientesHolder.mouseChildren = false; //ADD THE THUMBNAILS OF EACH PRODUCT TO A CONTAINER IN THE STAGE addChild(galeriaHolder);//thumbnails container galeriaHolder.x = 100; galeriaHolder.y = 400; for(j = 0; j < galeriaNumber; j++){ var tnLoader:Loader = new Loader(); var tnURL:URLRequest = new URLRequest(clientesXML.cliente[numeroActual].galeria.img[j].@tn); tnLoader.load(tnURL); tnLoader.x = 155 * j; tnLoader.y = 0; tnLoader.name = "" + j; var tnHolder:BotonMC = new BotonMC(); tnHolder.addChild(tnLoader); tnHolder.buttonMode = true; galeriaHolder.addChild(tnHolder); //UP TO THIS POINT EVERYTHING WORKS FINE AFTER BEGINS THE TROUBLE tnHolder.addEventListener(MouseEvent.CLICK, tnHolderCK); function tnHolderCK(event:MouseEvent):void{ var fullImgLoader:Loader = new Loader; var fullImgURL:URLRequest = new URLRequest(clientesXML.cliente[numeroActual].galeria.img[j].@full) var fullImgHolder:MovieClip = new MovieClip(); fullImgLoader.load(fullImgURL); fullImgHolder.addChild(fullImgLoader); addChild(fullImgHolder); } } } //REMOVE THE THUMBNAILS FROM THE CONTAINER function borrarGaleria():void{ while( galeriaHolder.numChildren > 0 ) galeriaHolder.removeChildAt( 0 ); } //TWEEN FOR THE function botonComplete():void{ botonVolver.visible = true; TweenLite.to(botonVolver, 0.5, {alpha:1}); TweenLite.to(rect, 0.5, {alpha:1}); TweenLite.to(cuerpo, 0.5, {alpha:1}); TweenLite.to(barraScroll, 0.5, {alpha:1}); // TweenLite.to(imageHolder, 0.5, {alpha:1}); } //FUNCIONES DEL MENU// The main problem is when i try to set a name for every thumbnail and then use it in a function outside the main button click function. I tried also to load the thumbnails and put the for loop outside the main menu click function but also i can't get the correct node in the XML to load the images that should be loaded. I've checked a lot of XML galleries in order to see how to make it work, but i can't. Any help would be great. Thank you, Rodrigo. PS: I uploaded the source files but in there the comments are in spanish, but is the same code. websnap.cl/XMLMenu/Menu%20XML.rar
how to get menu to pop up in Android app   (124 Views)
anyone out there know how to get a menu to pop up in Flash CS5 when coding for an android app. Basically I have a nice, simple app that when you press the menu button on your phone I want a movie clip to pop up at the bottom of the screen that then acts as a menu for the app. When you press the menu button again the movie clip disappears. There is some code in the sample files in flash cs5 but it won't seem to work for me. Has anyone gotten this to work successfully for them.
Deceleration of an infinite menu on mouse out   (117 Views)
Hi all, I've been building an "infinite menu" using script from a tutorial that I found and modified. The original script allows users to scroll through a series of pictures (contained in a movieclip) by moving their cursor either to the left or the right of the center of the menu- the farther from the center, the faster the menu scrolls. I added functions that cause the menu to stop scrolling when the cursor leaves the animation. However, I want the menu to decelerate smoothly, starting from whatever rate it was moving at when the mouse out event occurred and finishing at a stand still, and this is where I'm having some Serious Issues. I've managed to make it work correctly for the first time the mouse out event occurs, but whenever I mouse on and then mouse out again the images move at (apparently) random speeds and directions. At this point I don't even have a guess at what could be causing this, much less how to fix it. Any suggestions would be very much appreciated. I realize my code is probably not as clean or streamlined as it could be- I'm still pretty new to this whole AS thing. I hope it's clear enough for you all to understand easily enough. ActionScript Code: var xcenter:Number=425; var speed:Number=.03; var mouseyGone:Boolean=false; stage.addEventListener(MouseEvent.MOUSE_OVER, MouseyOn); stage.addEventListener(MouseEvent.MOUSE_OUT, MouseyOff); stage.addEventListener(Event.ENTER_FRAME, moveIt); //indicates that the mouse is over the stage function MouseyOn(event:MouseEvent):void { mouseyGone=false; } //indicates that the mouse is off the stage function MouseyOff(event:MouseEvent):void { mouseyGone=true; } function moveIt(event:Event):void { //moves the scrollbar when the mouse is on the stage if(!mouseyGone) { if (mouseX > 525 || mouseX < 325) { var distance:Number=mouseX-xcenter; menu.x+=(distance*speed); //this makes the mc appear to loop if (menu.x > 0) { menu.x = -1000; } if (menu.x < -1000) { menu.x = 0; } } } if(mouseyGone) { //moves the scrollbar if the mouse is off the stage if (mouseX > 525 || mouseX < 325) { var distanceNow:Number=mouseX-xcenter; if(distanceNow 0) { menu.x = -1000; } if (menu.x < -1000) { menu.x = 0; } } else { //if mouseoff was right of center, decelerate to the right var decelR:Number=(menu.x-=(distanceNow*speed)); decelR*=.02; menu.x-=decelR; if (menu.x > 0) { menu.x = -1000; } if (menu.x < -1000) { menu.x = 0; } } } } }
Help with a scrolling blur menu   (147 Views)
I bought a horizontal scrolling Menu. Actually it works nice, but i have some problems to modify it. I already tried to get in contact with the author of the menu, but without success :-(. I hop i cant get some help here and would appreciate very much if somebody could take a look at it and give me some suggestions. Here is my problem: When sliding over the menu Thumbs, i want the popup text below to be black, not white. As well i would like to remove the four little corners outside the thumbs, which appear when scrolling over a thumb. Please help me. Many
Android app menu swipe   (118 Views)
, Im currently trying to make a prototype application in flash to port to my mobile. Theres a horizontal menu i have in it that i want the user to be able to swipe right or left and the menu objects (squares) reel that way till its 'momentum' runs out. There are 4 box objects in the menu and the ones at either side hang out the side, so to make it reel, theyd have to go through a magic door to the other side if u get me so that they can reel on and on.
I need flash canvas menu ...   (259 Views)
.. I need an flash canvas menu, written in AS3... In any shape, any type, it doesn't matter... Please help...
How to keep a menu on top of loaded swfs   (201 Views)
This may seem a stupid question but I just started learning AS3, sorry. Is it possible to keep my menu on top of externally loaded swfs I believe it should be but I just cannot figure out how to do it. I have searched around and I believe I should use something like addChildAt but when I try to use it in the main menu actionscript my external swfs do not load anymore... My menu is sitting on the main timeline as movieclip and the externally loaded swf overlap my main timeline completely completely covering my menu... Can someone please show me how to do it , Hi and thank you so much for sharing your code. It seems very hard to get help since they dont believe you are trying to get your code to work! I will try it and post back to let you know. Lets keep in contact so maybe we can share what we have achieved so far... thank you
AS3 addChild to array generated menu   (146 Views)
I'm familiar with AS2 and just getting started with AS3. I found a submenu fla I would like to use, and I have everything set up, just not sure how to attach movies from the library when someone clicks a navigation button. In AS2 I would have made an empty mc and used attachMovie when the button is released. I've looked at some of the addChild questions and tutorials here, but since I'm working with pre-written code for a submenu, I'm not sure about how to modify what I've read to work in that code. Here's the code that sets up the submenu, the last function (navigate) is where I'm not sure how to instruct flash to load an mc when one of the buttons (from the var subButton:Array) is clicked. The MCs in the library correspond to the array entries ie: s.home has a library item mcHome, s.web has library item mcWeb that would load when they click that button... var s = this.services.subBar //create a variable to shorten the path to the buttons in the sub bar var subButtons:Array = new Array(s.home, s.it, s.web, s.graphic, s.contact); // create an array with all the buttons in the sub bar for (var i:int = 0; i< subButtons.length; i++) // create a for loop to add the CLICK event listener to all the buttons in the sub bar at once { subButtons[i].addEventListener(MouseEvent.CLICK, navigate); // add the click event to all the buttons } function navigate(e:MouseEvent):void // create your click function { trace(e.target.name); // this is just a trace to make sure the buttons on the submenu are working // all navigation for the sub bars buttons goes inside this function. text_txt.text = e.target.name; //this is another test to make sure the buttons are working } Any insight would be appreciated, and I think will open up the possibilities for me to use AS3 in the future.
trouble making accordion menu   (147 Views)
hi, I'm fairly new to actionscript and am trying to create an accordion menu that contains three submenus. The idea is that when you mouseover one submenu (or rectangle, to keep it simple) that the rectangles which were previously covering it will move to reveal it. If you want an idea of what I'm talking about, menus of this type can be found at the bottom of nvidia's[COLOR=blue ! important][COLOR=blue ! important][/COLOR][/COLOR] site (www.nvidia.com) for reference. At first I tried creating each function, which will make the rectangles move, separately but this resulted in three very repetitive functions and there seemed like there should be a better way, especially since I'd like a good way to add and remove submenus. The animation did work then. I tried to clean it up by creating a for loop that would move each rectangle but now, for some reason, it doesn't work. It is still missing some key points such as utilizing the mOver variable to figure out when each rectangle is moused over and act appropriately
Vertical menu that scrolls horizontal   (131 Views)
I'm trying to recreate this type of menu. http://bit.ly/dub1CL this is a video to show the action of the menu, wanted to save you the time of going through their painful intro. There has to be a AS out there already for this. I'm willing to pay to have this created as well.