ActionScript 3.0 :: Document Class - Building And Adding Menu Items?
Jan 18, 2010
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.
View 1 Replies
Similar Posts:
Apr 27, 2010
I am trying to learn how to add sub menu items to my main menu which is being generated using XML. I have been able to add the top level menu items but I am not sure how to integrate the sub menu items. a link to my development site [URL] In my code I have a variable showInMenu this value is true if it is a top level menu item and false if it is a sub menu item. If I list out the XML menu items they look like this where About Us is a top level menu item and Our Mission is a sub menu item of About Us. how to set up the sub menu items. I attached the fla with xml file.
[Code]...
View 0 Replies
Feb 4, 2010
1. An XML list, which works just fine, retrieves between 3 and 15 strings (or menu names). These menu names are put into an array called, "aGalleryMenuID".
2. I want to be able to create a MovieClip and TextField dynamically for each string and place them on the stage dynamically. So if there are only 5, it will make five. 3 will only make 3. The long way of doing this is to create 15 MovieClips and 15 TextFields and use a loop to use addChild. This is okay, but what if later it is decided there needs to be 30 menu items. I want to avoid that and make this future proofed.
for loop that loops through the # of array items in aGalleryMenuID
set the MovieClip's name to a unique identifier
set the TextField's name to a unique identifier
[code]...
View 2 Replies
Feb 27, 2012
What is the best way to make a menu with items that can be bought ( a.k.a shop ), bought items are invisible and there are about 20 items or so. What's the better approach than adding mouse event listeners to all 20 items?
View 2 Replies
May 3, 2010
I've been running circles around this preloader I have for days now. There's a number of problems, but the main one I can't seem to figure out is how to retrieve a library asset from an external class that's not the document class.I have a Preloader_mc class in the library. But the Document.as class doesn't need it really. I only need it once I instance the actually Loading.as class. So I'm trying to access it from the Loading.as and I'm not getting anywhere.I also gave up by instancing it in the Document.as and then referencing it by:
Code:
Master.preloader_mc
or
Code:
Master(root).preloader_mc
Static or not, I just wanted access to the thing for once. Which worked until I had to remove it from the Loading.as. Then it wouldn't budge no matter what I typed.
View 7 Replies
Aug 19, 2010
I have a symbol named picHolder. In symbol properties under linkage, I chose "Export for ActionScript" and "Export in frame 1" and gave it a class name of picHolder.Normally, to instantiate a new instance, I'd say:
Code:
var tempPic:picHolder = new picHolder();
and I'd go about my way.
[code].....
View 1 Replies
Nov 24, 2011
The name of my DocumentClass is Main. So, what's the difference between :
var myClass:Main = new Main();
var mcInLibrary:MovieClip ;
/////////////////////////////////////////[code]............
View 1 Replies
Oct 9, 2008
I have a main menubar.fla file, which has a document class on it linking to a menubar.as. the as3 file is just some simple Papervision3d stuff, and creates a few buttons on the stage from the library. Here you can see the project as it is now I am trying to make it so when your mouse leaves, the the head will tween back to facing forward. But to find the mouse leaveing, I am using the code found HERE In an FLA without a document class, it works fine, but when I add it to my menubar.fla I get the errors:
1046: Type was not found or was not a compile-time constant:
TextField.
1180: Call to a possibly undefined method addFrameScript.
The first one comes from the text box alone on the stage.I had a similar problem when adding the buttons, that eventually made me link them for actionscript and just create them directly in the AS file, because placing them on the stage threw similar errors. I would do that for this code too, but according to the source site, "This event is only available added to the stage."
View 3 Replies
Sep 7, 2008
From a tutorial page, I manage to built this flash page with xml capabilities. But when I add more scene to the flash page, I have errors like this.
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at MyContent/init()
at MyContent()
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at MyContent/onComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
How do I edit the "MyContent.as" file so that I can add more scene to the flash. I understand that, once i put the "MyContent.as" in the document class, it will load immediately, is there any way to tell it to load only in scene 2 (which is where the xml is needed).
View 1 Replies
May 25, 2010
Im sure this is quite simple but for some reason I cant get it to work, and it does not throw an error so I dont know whats wrong...
In the library of the main swf file a movie called navigation has been exported to class: 'NavMC'[code]...
View 2 Replies
Jun 5, 2009
How do you add several similar movie clips to the stage from the Document Class?
E.g. I've got four different movie clips called ball0_mc up to ball3_mc.
Also, how do I add each movie clip to random points within the stage parameters?
View 1 Replies
Dec 14, 2010
I am dispatching an event from one document class and listening for it via another document class.My code in class A.
Code:
this.dispatchEvent(new MYEvent(MyEvent.APERTURE_DONE));
trace("Dispatching APERTURE_DONE");
my code in class B.
Code:
addEventListener(MyEvent.APERTURE_DONE, onDoorsOpen,true);
trace("Lisetning for APERTURE_DONE");
[code]....
My listener is registering before the event is dispatched, based on my output window, however I never get the "Open Doors" trace statement to fire.
View 2 Replies
Mar 31, 2007
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 ?
View 1 Replies
May 7, 2011
I have a FLA (say Main.FLA) document class with a child MovieClip on the stage: into the child MovieClip I load other swf files: each of the files contains its own Document Class (every swf is a somewhat independent application, say quizzes and so on).For some reason I must use the Main document class to store data (scores or so) from the child swfs loaded into the Main swf. HOW do I reference the Main class? I can't find a way.[code]and dispatch an Event this way from the loaded swf document class to the Main class:[code]Now, first of all I don't know if this could even work. Secondly, I tried to make it work by adding an event listener to my Main class but id did not work.
View 9 Replies
Sep 22, 2008
So I had a working .fla, with a document class package in the same directory. Everything was fine, until moving both to a new directory, now the fla cannot find the document class. WTF?
View 2 Replies
Jul 4, 2010
I am working on a DVD User Interface for my final project in Photoshop. For extra credit points I am trying to figure out how to make the menu items to light up when the pointer is touching the menu icon.
View 1 Replies
Sep 21, 2009
I need to add a couple menu items to an existing Flash menu that I did not create, but I am having trouble figuring out how to make the buttons stay highlighted until you click another one. Best way to simply describe my problem since is to simple show you. The first 5 links work exactly as they should. But the last 2 (Careers and Client login) do not stay go highlighted on the loaded page. [URL]
View 9 Replies
Sep 1, 2010
scrolling 2 sprites. Look at the image below. [URL] FLA LINK (please take a quick look)[URL] I have this entire program working but i need to scroll the left menu and the menu where all the items are added. One more thing, the right menu can have only an few items at a time that do not need scrolling but when more are added then the scrolling will need to take effect.
View 0 Replies
Jan 10, 2010
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.
View 4 Replies
Oct 12, 2009
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.
View 2 Replies
Jan 21, 2010
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
{
[code]........
View 1 Replies
Sep 13, 2004
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:
[Code]...
View 1 Replies
Sep 13, 2004
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:
Code:
menuYearItems = [0, 4, 6, 5, 9];
menuYear = ["2004", "2003", "2002", "2001", "2000", "INFO"];
i = -1;
[code]....
View 1 Replies
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.
View 3 Replies
Nov 20, 2009
I am building an autocomplete menu system, and need the general function to be simple as I will be adding a lot more functionality to it later...
this is my start, but it returns too many results, how can I bind the results?
[Code].....
View 1 Replies
Mar 10, 2005
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.
[Code]...
View 8 Replies
Jun 12, 2006
Does anyone know of any other tutorials or components to building menus similar to these..[URL]...
View 2 Replies
Dec 13, 2009
I'm trying to make an XML driven popout menu (click a menu item to open its submenu) and have run into a snag. I haven't figured out how to "hide" elements that aren't supposed to be on the screen.The menu is constructed completely out of TextFields based on the structure of a simple XML file. I added Event Listeners to each of the TextFields but I can't figure out how to make those TextFields go away when they are not supposed to be seen.
I have tried to add each TextField onto a common DisplayObject and the use container.removeChild to remove the TextFields that shouldn't be there but I keep getting errors telling me that the target of removeChild must belong to the caller. So how do I manage the visibility of menu items based on mouse clicks in a menu?I've attached the specific AS file (SOMAMenu.as) that handles the menu if anyone finds that helpful.
View 2 Replies
Jun 3, 2010
I have entered the following code and both items do import, but i cant control the label of the second library item called "Cool"After doing some digging, i think i found out the class name of the second object was called "Cool" and the base class was "import flash.display.SimpleButton;" so it looked like i had to import that class at the top like i did! But still not working. and still no joy!I think i need to add in "public class Cool extends SimpleButton" so it inherits the SimpleButton class after the first public class and then create a new function called "public function Cool() " and then add the function body but when i go to do that it all goes wrong. Am i on the right track or am i missing a trick!!
package
{
import flash.display.Sprite;
[code].....
View 3 Replies
Feb 24, 2009
I've got a combo box adding items from an array. The labels are working just fine, but adding the data with a variable won't work for me. If I put in an actual number, I get that result, but trying to add it with a variable I always get 1 as a result. classData only ever = 1. I can access the array. I know it must be in the syntax.[code]
View 2 Replies