ActionScript 3.0 :: Organize A Menu Of Items Would Be A Dictionary Object Containing All Its Members?
Sep 3, 2011
My project is a visual way to represent a database of information about books. It will be represented as a collection of menus and submenus. From one menu, the user will be able to access another, from the other the third.Each item in a menu has some content, so the menus themselves are not a means to an end (to execute commands), but a goal in themselves. Viewing them, and browsing between them is the essence of the project.
The simplest way to organize a menu of items would be a dictionary object containing all its members.However, it is not really good for a complex set of menus and sub-menus which is a web of information linked between another.
I am encountering a problem in my app only when it is run in flash player 10.1.85.3. Some earlier player versions I have tried are working fine.From what I can tell it seems related to the following:
Quote:
from here: h[url].....
When searching for objects (not strings) in Dictionary objects using the 'in' operator, if the object is not found in the Dictionary object, it will be searched for in the delegate objects. With 10.1, the toString operator will be called on the Object if not found in the Dictionary. This can cause problems with Proxy objects who need to define the callProperty function or it will generate a RTE. ...what it means "it will be searched for in the delegate objects"?
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.
I'm often seeing others using a Dictionary object in their AS3 code that simply maps objects by String keys and wondering if there is any advantage at all of using a Dictionary over a simple Object if String keys are used. Anyone know any details on this? I would suppose that since an Object is more lightweight it should be faster and preferable over a Dictionary if used with String keys.
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]
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.
What exactly is the difference between an object and a dictionary in Actionscript?
var obj:Object = new Object(); obj.something = "something"; var dict:Dictionary = new Dictionary(); dict.something = "something"; trace(obj.something, dict.something);
So I am writing a program which uses Dictionary to store objects. For example
var dictionary:Dictionary=new Dictionary(); var myObject = new myObject(var1, var2, var3); dicionary["key"]=myObject;
where var1, var2, and var3 are simply means of assigning values to variables in myObject.can I access values or functions that are found in myObject? In myObject class I have some getters and setters. Can I use a getter to get the value of var1 for example.
Any good argument as to why I shouldn't use a Dictionary over an Object every single time? I can't think of any case an Object can do the job a Dictionary can't, and it doesn't seem as the Dictionary creates that much more overhead.
In one of the classes in my Flex application I have a dictionary, which is periodically updated from other parts of the application. It contains some sort of user preferences and I want to keep it in sync with a local shared object - the dictionary needs to be read during the class initialization and saved to the local storage when an element is changed, added or deleted.
The "Dictionary" object inherits only "Object" and does not have a change event - like the "collectionChange" in ArrayCollection. So I can't sync the dictionary just by listening for an event and manipulating the shared object in the event handler. The other possible solution would be to make the dictionary private and manipulate it using special methods in my class. Something like:
public function setValue(key:String, value:String):void public function getValue(key:String):String public function delValue(key:String):void
But using bindings will become a real nightmare and I will have to make changes in many other parts of the application.
I'm creating an xml generated gallery/menu, I have the gallery and menu populating fine but my issue arises when I try to make the menu items clickable.
This is inside my populate menu function _root["mainMenu"+[i]].onRelease = function() { trace(this); var splitThis:String = this var splitThisArray:Array = splitThis.split("Menu"); trace(splitThis) trace(splitThisArray[1]) };
Now the trace output I get is _level0.mainMenu1 _level0.mainMenu1 undefined
Although when I set splitThis to "_level0.mainMenu1" manually I get "1" or whatever number comes after "Menu".
I have two PNG images that have text in them as menu items. When clicked, a new XML file is loaded and new set of photos is displaying.Everything works fine, but I want the menu item to be highlighted when hovering the mouse over the item. In other words, so that new image is displayed in place of the old one on MOUSE_OVER, and the old image is back on MOUSE_OUT.
As of now I have two menu items, Portraits and Weddings, movie clips where they are displayed are MenuPortraits and MenuWeddings
I have following properties:
[Code]...
I do see switching of images, but if I leave mouse over - it switches back and forth with high speed. Eventually, when I move mouse out - it can stuck on highlighted state.
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.
I've been trying to create a menu bar like this [URL] but the menu bar I create doesn't come over the items on the website. How to create those type of menu bar.
whether using a String as the key in a Dictionary results in slower lookups than using an Object, Class or Custom Object (an instance of developer defined Type)?
When using a String as a key, does the literal String have to be parsed, or does the Dictionary key point to the String Object?
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{ var id:int; var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
A good button should have all the available out, over and down states, and often there are a bunch of nice to haves such as animation, disabled states, filters, you name it. I seem to change my mind in each project I do. The last one, I reskinned and extended the Button Component. The project before I extended SimpleButton Before that I built my own custom class using a Sprite and TweenLite. Then of course you need to work out if you will use library items which is great for laying out on stage, or do everything from scratch using code, which is more powerful but crap for design. I haven't looked at the swc or component route myself.
Building a website for myself and I know a bit of flash but not much. Mostly following tutorials and adapting for my own purposes. Anyway I am building a menu bar, which when you hover over certain items drops down a submenu. I can get the submenu to drop down ok but I cant figure out how to get it to link (jump) to a new frame/scene. I think problem is in function showSubMenu? Flash CS4, AS3
Code: // SETTINGS // Make submenu buttons hidden btn_Set.btn_Set1.visible = false; btn_Set.btn_Set2.visible = false; // Add event listeners for main button [Code] .....
I have been working on making a menu for list items. The file below has an animated menu. If you click on Artificial Intelligence on frame 60, it jumps to frame 61 (a specific section for that list item). How do I make the Artificial Intelligence button on frame 61 jump back to frame 60? I dont know where to add the action script for the function. I need to add a similar script to all 9 list items, do they go on one actionscript file? if so what location? [URL]
I created a 3D carousel in CS5. It works wonderfully. For now, I have it set up so that if someone clicks one of the menu items, the output window say "commited suicide after being cyberbullied", what I want to do is either have different text (that shows in the window) for each of the eight menu items when clicked, or 8 different URL links for each of the menu items, when clicked.
I am using Adobe Flash CS4 Professional. I have a simple navigation menu that I am trying to edit. I may be in the wrong place in the file, but when I open the .SWF files I can see the lines of code and I can see the actual navigation menu as it appears on our web site. I have not been able to figure out how to change / edit / delete the line inthe drop down menu that I want to delete on our web site.
I do not know why but I see that itemclick event on a menubar do not fired unless you click a sub item. What is the clean way to handle clicks on menuitems which are on the top level and do not have sub menu items. For example I want to fire an event whenever MenuItem B is clicked.