ActionScript 3.0 :: RemoveChild From Dynamic Menu?
Oct 24, 2009
I'm using a class to dynamically populate menu items based on arrays. The menu has to allow individual chapters and lessons to expand/contract to display the slides within.
I'm trying to set it up so that when the user hits the Chapter or Lesson item, it rebuilds the menu with the appropriate Chapter/Lesson expanded. I've got that part working, but I need to remove the elements that were previously added using addChild, but I'm not sure how to clear all the elements from an object?[code]...
View 11 Replies
Similar Posts:
Nov 14, 2009
I'm trying to develop a simple elastic menu in AS3. I have a class named "menu" to create a vertical menu with n elements using a MovieClip from the library. It is linked properly as "base_primaria" and with MovieClip class as base class. Every element in the menu is in button mode and when is clicked calls a method (crearsub) to create a submenu. I have another class named "submenu" that creates a submenu with n elements using a MovieClip from the library. It is linked properly as "base_secundaria" and with MovieClip class as base class.
All the elements in the main menu must be relocated depending on the .y position and their .height. For that I'm using a method inside "menu" class named "posicionar". To animate the elements I use TweenLite. The first problem is I want to relocate all the elements through TweenLite and it is not working. Probably the "posicionar" function is wrong. The second problem is I want to click in one element from the main menu and it creates its own submenu. If there is one element with a submenu created, it must to disappear. All the elements must to relocate in real time in every click.
Here the "menu" class code:
Code:
package classes.menu{
/** * ... * @Roman Perona */
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.events.Event;
[Code] .....
View 7 Replies
Jul 5, 2010
I have added a Child from my library as follows:
Code: Select allfunction menuIn(param1:Number=0, param2:Number=0):void {
var menu_mc: menu = new menu
menu_mc.x=220;
[Code]....
How can I then remove it, I get this error: 1120: Access of undefined property menu_mc.
View 2 Replies
Sep 15, 2009
This is my code to addChild and removeChild when clicking a button. And i know there is a way to make this more dynamicly instead of hardcoding it.
ActionScript Code:
// Yatzi-knapp
yatzibtn.buttonMode=true;
yatzibtn.addEventListener(MouseEvent.CLICK, onClick);
[Code].....
as you guys can see it addChild with dynamics and its not hardcoded. difference between adding a movieclip from the library and loading a swf external?
because i cant get this to work. Even tho my code does addChild and removeChild i get error-messages in the output. The movie works fine but it isin't a pretty code
View 0 Replies
Oct 31, 2010
I'm not even sure if the title reflects what I want to do. Here's backstory. I have a movieclip with 5 'holder' movieclips in them. They are my containers for dynamically added movieclips. The parent containers has an instance name of pyramid, the holder instance names are labeled after the 6 food groups, i.e., 'grainholder', 'fruitholder', 'vegetableholder', etc etc...The holders are within the pyramid container, instance names as above, and the pyramid container is added to the display list. I have a addFoodToPyramid() function which adds 'foodMC' mc's to their respective holders. So an [object Apple] will be dynamically added by way of pyramid.fruitholder.addChild(Apple). The function also adds a listener. Heres the call and the function:The call (I will use grains as example) is this:
addFoodToPyramid(grainArray, grainHolder, grainCounter);
And the function is:
function addFoodToPyramid(thisArray:Array, thisHolder:MovieClip, thisCounter:Number):void
[code].....
View 2 Replies
Mar 29, 2007
I have created a sliding menu. But that is static( the number of rows are fixed). i want to create a menu with the number of rows dynamic.I have attached the fla file here.
View 10 Replies
Mar 29, 2010
I'm trying to build a conditional statement that will addChild and removeChild at different Timer Delays. Before I go any further, I thought, I should mention that I'm usinig TweenMax to ease the alpha of ease Child from 1 to 0 and back during the process to imitate a fade-in/out.
I'm getting issue with only one line - inside a conditional statement.It's running "OK". The movie runs as I want it, but the remove/addChild transitions are not at the speed I want it at. I am getting an error message in the output, but other than that, the movie runs fine.
stop();
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
[code]....
View 2 Replies
Oct 14, 2009
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?
View 2 Replies
Feb 21, 2009
I cant do 2 removeChild(); 's beneath eachotherSo their always will remain 1 child how can i delete that one?
addChild
removehild does work
removeChild
[code]......
View 2 Replies
Sep 6, 2004
i want to create a menu like one in this tutorial. but my xml file is little bit complicated to me. i don't have any attributedsin my xml. this is my xml file
<CD-structure>
<Product_Group>
<ProductGroup>DI</ProductGroup>
[code].....
View 1 Replies
Aug 3, 2002
I have a nice looking dynamic menu but only one menu with submenus. Will someone with better Actionscript knowledge than me help out to create menus and submenus below?I am attaching the exported .as file.
View 2 Replies
Feb 21, 2005
For the life of me, I can't get it to work. All I want to do is roll over and change the background color of the cell. I've tried adding it in as a behaviour in the submenu movie clips. But when i try to trace the onRollOver, nothing happens.This is how the XML looks.
Code:
<?xml version="1.0"?>
<menu>
[code].....
View 3 Replies
Mar 5, 2010
Lets say i hava category and some articles in it (one article - few photos and description). I want to make a thumbnail menu in footer each thumbnail linking to an article. The question is how to make this menu to load automatically? If i put articles in category/article1, category/article2 (and so on) folders, I want to see two thumbnails linking one to first article, second thumb to secont article. If i add one more article, i want thumbnail to be loaded to site automaticaly
View 4 Replies
Jan 8, 2010
I got the first part to work. The only problem is when I click any buttons it produces errorTypeError: Error #1009: Cannot access a property or method of a null object reference.at resume_fla::MainTimeline/frame1()not sure what I have to do. All it's supposed to do is when you click a button the target movie clip plays frames 2 - 10 and the previous movie clip plays frame 11 - 20. Not sure what's the problem here.
ActionScript Code:
//variables
var curMC;
[code]......
View 1 Replies
Jul 3, 2010
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'.
[Code]...
View 0 Replies
May 19, 2011
I guess that my problem is really simple, but I have no idea, how to do it.. The idea is simple: I need to make dynamic menu with mouse over effect. Button and hover are from library. When I go with mouse on button i want to make hover visible, but I have no idea how to get to the hover, because there is no e.target. Look into the code:
[Code]...
View 1 Replies
Jan 21, 2003
Lostinbeta utilises a sliding menu system with a delay so that the section head follows after the content. I have been looking around for a tutorial but haven't found one to date
View 1 Replies
Feb 9, 2003
I'm trying to create a dynamic menu where the menu items are coming from an ASP page. I'm passing a string to the flash movie containing the menu headings, the flash script then creates the appropriate number of copies of a menuitem sub movie. This works fine. The problem however, is that I can't seem to dynamically set the onPress event for each movie.[code]...
View 7 Replies
Jun 29, 2006
I have been working on making a menu that gets it's content from an XML file.
menu.xml
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<links>
<link name="HOME" ref="index.cfm"/>
<link name="HOW IT WORKS" ref="hiw.html"/>
[code]....
I want to load the menu horirontally and have the buttons resize to the width of the text with a margin on each side. I need the margins to equal the remaining width of the menu stage divided by the menu items(nodes) divided by 2.I have spent hours on this and now have very choppy actionscript code in my source.
menu.fla
Code:
var linksXML = new XML();
linksXML.ignoreWhite = true;
linksXML.load("menu.xml");
linksXML.onLoad = checkLoading;
[code].....
View 1 Replies
Dec 2, 2006
There is a fantastic mouse sensitive merry go round 'menu' within the kirupa site via the link:http:[url]....
It's situated under the first example, named basic camera panning.This is very hard code. I understand the principals, but personally am new to actionscripting, and therefore cannot piece together my own example from the code supplied, purely by not understanding the placing of the actionscripting.provide a *.fla file from the example that is explained in the link above?
View 4 Replies
May 28, 2009
trying to create a menu with submenus (after) but I can't multiply and load the array content in each one item..Just check out my code:
Code:
var links:Array = ["Link1", "Link2", "Link3", "Link4"];
var bt:MovieClip = new button();// from Library
[code]....
View 1 Replies
Feb 21, 2010
[URL]i want to create a menu like one in this tutorial. but my xml file is little bit complicated to me. i don't have any attributedsin my xml. this is my xml file
<CD-structure>
<Product_Group>
<ProductGroup>DI</ProductGroup>
<Description>Digital Images</Description>
[code]....
View 1 Replies
Jul 3, 2010
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:
Code:
_root.menu_mc.menu_panel_1.menu_button_1_1.menu_button_text.text = "home";
_root.menu_mc.menu_panel_1.menu_button_1_2.menu_button_text.text = "our approach";
[code]....
View 2 Replies
Jan 7, 2004
I'm creating a dynamic menu with XML, and this is part of my code. I've written in the code what the problem is:
[AS]
menuXml = new XML();
menuXml.ignoreWhite = true;
menuXml.onLoad = function(success) {
[Code]....
View 2 Replies
Jun 5, 2009
I am creating XML menu where the link names and target functions are coming from xml. My problem is that I can't pass target functions to MouseEvent.CLICK event. I have tried to read target functions from XML to a variable and put that to MouseEvent.CLICK event like this:
myXML:
<menu linkname="SCHEDULE" target="openSchedule"/>
<menu linkname="GUEST BOOK" target="openGuestbook"/>
[code]....
View 3 Replies
Jul 3, 2010
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:
_root.menu_mc.menu_panel_1.menu_button_1_1.menu_bu tton_text.text = "home";
_root.menu_mc.menu_panel_1.menu_button_1_2.menu_bu tton_text.text = "our approach";
_root.menu_mc.menu_panel_1.menu_button_1_3.menu_bu tton_text.text = "our work";
[code].....
View 1 Replies
Sep 26, 2009
I have been working on building a XML menu and I have been able to create the top level menu but I am not sure how to add the sub menu items in a drop down. I have a link to a zip file containing my XML and FLA file. I am using CS4.The top level menu items consist of the following and the sub menu options are listed. In this list, Items 1,2 and 3 are top level menu buttons and item 4 is a sub menu button that would drop down from item 3.
Animated Logo : 1
Welcome Video : 2
About Us : 3
[code].....
View 1 Replies
Feb 2, 2010
URL...Accordion like components (but multiple items can be selected)Each stack has multiple child stacked.The whole menu resizes depending on how many stacks are selected and a scrollbar is also shown if necessary.So how Do I go about creating a menu like this? Any pointers to boot?
View 1 Replies
Mar 10, 2010
I am trying to create a Dynamic flash Navigation Menu which will disable the button of the page you are on leaving the button in the "hit" state and then active it once you have called for a new page and deactivate the new button. I know this can be done with movie clips and some old school gotoAndPlay/Stop slight of hand but I would like to do this in actionscript so its nice, clean, and scalable for other projects.
[Code]...
View 1 Replies
Feb 10, 2009
Looking for a dynamic Infinite menu. I had create a infinite menu. from ([URL]) However, I would like to make it dynamic.
View 5 Replies