Dynamic Menus...
I've have been trying to create a dynamic rollOver menu, but I have had some problems with it getting to work correctly. I made the navigation bar into a movie clip and place the buttons, tween and frame labels inside the clip.The problem that I'm is that the script that I created on the hit area of the MC is conflicting with the button function that are on top of it. Would anyone have a solution to this problem?
Here's the code:
navBar_mc.onRollOver = function() { this.gotoAndPlay ("open"); } navBar_mc.onRollOut = function() { this.gotoAndPlay ("close"); }
The menu is very similar to the one seen here.
http://www.anotherprojekt.com/test_site/index.html
Any help would be appreciated....
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-17-2003, 03:02 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Dynamic Links Inside Of Dynamic Menus
hello, I am having a problem adding links dynamically inside of a menu that was created dynamically. Look here to see the movie. All of the menus are created dynamically with a for loop iterating through an array. As each menu is created I want the links to be created also. For this i have used nested for loops. My problem is labeling the link text. Here is all of my code.
code:
stop();
function default_location(){
topX = 10;
topY = 5;
bottomX = 10;
bottomY = 590;
bar._x = topX;
bar._y = topY;
}
default_location();
//number of menus
var numMenus = 6;
var menuTop = new Array();
var locationY = 5;
var locationX = 10;
//define the menu headings
var top0 = "New Home Buyer Program";
var top1 = "Franchise Opportunities";
var top2 = "Broker/Realtor Program";
var top3 = "Mortgage Broker Program";
var top4 = "Home Builder Program";
var top5 = "Company Info";
var menu0 = new Array();
//New Home Buyer Program Menu Items
menu0[0] = ["Get the Home of Your Choice Now", "www.nhba.com"];
menu0[1] = ["The NHBA Application Process", "www.nhba.com"];
menu0[2] = ["Find an Office", "www.nhba.com"];
menu0[3] = ["Complete an Application", "www.nhba.com"];
menu0[4] = ["Check the Status of Your Application", "www.nhba.com"];
menu0[5] = ["Available Property Specials", "www.nhba.com"];
//Franchise Opportunity Menu Items
var menu1 = new Array();
menu1[0] = ["The NHBA Franchise Experience", "www.nhba.com"];
menu1[1] = ["NHBA for the Franchisee", "www.nhba.com"];
menu1[2] = ["Exclusive Tools and Technology", "www.nhba.com"];
menu1[3] = ["FAQ's/Resources", "www.nhba.com"];
menu1[4] = ["Franchise Facts", "www.nhba.com"];
menu1[5] = ["Discovery Days Registration", "www.nhba.com"];
menu1[6] = ["Franchise Testamonials", "www.nhba.com"];
menu1[7] = ["Apply to be a Franchsie", "www.nhba.com"];
//Broker/Realtor Program Menu Items
var menu2 = new Array();
menu2[0] = ["What Brokers & Realtors Need to Know", "www.nhba.com"];
menu2[1] = ["NHBA for the Realtor", "www.nhba.com"];
menu2[2] = ["Request Information", "www.nhba.com"];
//Mortgage Broker Program Menu Items
var menu3 = new Array();
menu3[0] = ["What Mortgage Brokers Need to Know", "www.nhba.com"];
menu3[1] = ["NHBA for the Mortgage Broker", "www.nhba.com"];
menu3[2] = ["Request Information", "www.nhba.com"];
//Home Builder Program Menu Items
var menu4 = new Array();
menu4[0] = ["What Homebuilders Need to Know", "www.nhba.com"];
menu4[1] = ["How Lease-to-Own Works for You", "www.nhba.com"];
menu4[2] = ["Request Information", "www.nhba.com"];
//NHBA Company Info Menu Items
var menu5 = new Array();
menu5[0] = ["Company Overview", "www.nhba.com"];
menu5[1] = ["Contact Us", "www.nhba.com"];
menu5[2] = ["Management Team", "www.nhba.com"];
menu5[3] = ["Corporate Media Kit", "www.nhba.com"];
menu5[4] = ["What People are Saying", "www.nhba.com"];
menu5[5] = ["Pride in Partnership", "www.nhba.com"];
menu5[6] = ["Privacy & Security Policies", "www.nhba.com"];
menu5[7] = ["Site Map", "www.nhba.com"];
var numMenusLeft = numMenus;
//Create the Menus
for(i=0; i < numMenus; i++){
bar.duplicateMovieClip("bar"+(i), i+1);
_root["bar"+(i)]._y = locationY; //sets the initial location
locationBottom = bottomY - (28*numMenusLeft);//sets the bottom location
menuTop[i] = [locationY,locationBottom,_root["top"+(i)]];//assigns the menuTop array with the instance info
_root["bar"+(i)].menuName_txt = menuTop[i][2];
_root["bar"+(i)].name = "bar"+(i);
_root["bar"+(i)].id = i; //assigned id as array index (id = 0, 1, 2....)
_root["bar"+(i)].up = true;
locationY += 28; //increment locations for next menu
numMenusLeft-=1;
var len = _root["menu"+(i)].length;
//trace(len);
var linkY = 45;
var obj = new Array();
x = i;
for (j=0; j<len; j++){
//THIS IS THE PART THAT IS NOT WORKING
obj[j] = _root["bar"+(i)].link.duplicateMovieClip("link"+(j), j);
//_root["bar"+(i)].createEmptyMovieClip("mc"+j, j);
//["mc"+(j)].createTextField("txt", j, 0, linkY, 130, 40);
trace(obj[j]);
//IT DOESNT ASSIGN THE TEXT TO THE LINK
obj[j].link_button.link_text.text = _root["menu"+(i)][j][0];
obj[j]._y = linkY;
linkY += 30;
}
_root["bar"+(i)].link._visible = false;
//trace(obj.length);
for (k=0; k<obj.length; k++){
trace("Link:"+k+obj[k]);
}
}
_root.bar._visible = false;
function moveMenus(button_id){ //button id is coming in as the array index (0,1,2...)
//loop through all of the menus
for (i=0;i<=(menuTop.length - 1); i++){
if(i<button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if(i == button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if (i>button_id){
if (_root["bar"+(i)].up == true){
easeDown(i)}
}
}
}
/*This is how to use the MX easing tween:
var tabUp = new mx.transitions.Tween(movieClip, "_y", mx.transitions.easing.Bounce.easeOut, beginCordinate, endCordinate, time);
*/
function easeUp(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][1], menuTop[menu][0], 12);
_root["bar"+(menu)].up = true;
}
function easeDown(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][0], menuTop[menu][1], 24);
_root["bar"+(menu)].up = false;
}
Any help would be MUCH appreciated.
Dynamic Menus
Hi
i need to build a tree menu from a textfile that contains all the info about the menu entries. a good example of what im looking for is at http://www.illustra.ca/dev/option_system/
It's a fla i've took here http://www.flashkit.com/movies/Appli...74/index.shtml
and trimmed all the things I don't need. This movie only
works when exported in flash4 format, but i want all my movie flash5. Anyone has a great flash 5 example or a way
to have my example to work in flash 5?
thanks
Dynamic Menus: Help
Hello: I am a Flash 5 user, and I want to construct a Flash menu like this : http://www.flashkit.com/tutorials/Ac...41/more3.shtml
THe problem is that I'm unable to make out the while action on that page. Could anyone help by trnslating it in intelligible language? Thanks a lot.
If it's not asking too much could anyone be able to send me a .fla file similar to that one? It would be really cool and easy tounderstand.
Dynamic Menus.
Okay, I want to make a dynamic (external file driven) menu.
What I want each menu item to pull from a file is.
1. The label (what the menu item is).
2. Lower movie name (an image that will appear below the menu for that menu item).
3. HTML formated text for right pain (the text that will appear for the menu item).
Then I want it to build the menu system for me, now I've been wondering how to go about this, do I limit it and have a script build a series of buttons for me, or can I make a textual menu system with scrolling ability?
The magic part really is it needs to build the menu by making the first menu item, labelling it, then including the code set a variable which holds the info for the image and the text.
Where do I start? ;p
Dynamic(?) Menus
Ok, I have a nav bar that has buttons like "pictures", "sounds", "stories" and when a user presses one of those buttons, I want a list to be loaded (this would be in the sidebar)...Is the best way to do this to create a seperate .fla file for each list and have an actionscript command load each one up?
Dynamic Menus
I was wondering if this is possible. Imagine if you will, putting in a CD and having it autorun a flash file. This flash file opens and has a menu system. Basically imagine a square. A column of buttons on the left and an empty frame on the right. When you click on the "Word Documents" button on the left column a complete list of the word documents contained on the CD is displayed in the right empty frame. Clicking on a word document opens that document. When you click on the "Powerpoint Documents" button the right frame changes and the list of powerpoint docs replaces the word docs. Clicking on a powerpoint doc opens it. Is such a menu system possible in Flash? I know the left menu buttons changing the right frame content is possible, but what I was really wondering is if its easy to make the right frame content change easily? Or does it have to basically be recreated for every single disc when the content changes? Specifically, is there a way to make a generic file I can just change text and link info in that will be pulled up by the left menu buttons? I would hate to have to recreate this file from scratch EVERY time. Also this right frame would need to dynamically put in a vertical scroll bar if content changed and the amount necessitated one. I am just trying to automate a project before I start it and dont want to waste a week trying to figure it all out if someone else knows it isnt possible. Thanks for any help.
Dynamic Menus Are A Nightmare.
Hello all,
Here's what I'm trying to do:
I've got a menu that works like a pulldown menu made in HTML. I already have the menu setup, and it would work well, but the problem is is that it's static. I need to scrolling pulldown to create the buttons dynamically. The way I have it trying to work is that I have a PHP script which pulls the menu options out of a MySQL database as an array, implodes the array into a string, then sends the string to the flash movie. Once in the movie, the problem begins. How do I explode the string back into an array, and after its an array, how do I create the list of buttons labeled the item in the array, and then have them, when clicked, set a variable which is in Level 0 to the correct value corresponding to which button it is, the variable would be the same name as the label.
I know that's a big question, but this is critical to my sites design.
Thanks in advance,
Ralph
Building Dynamic Menus.
Hi boys and gals!
i have been working on this for quite a few days now and my mind has started to mess around with me a bit. So i've come here again to beg for your help. I know I've seen a thread about this (or was it a tutorial in were-here...?) but can't find it anymore.
I'm trying to make a dynamic menu with the options where you can add or subtract menu items.
Say there is 3 main menu buttons and each of the main menu has 4 sub menu buttons and each of the submenu has another 3 sub-submneu buttons.
I'm initiating the menu build by counting the different menu items like this:
menucount=3
submenu1count=4
submenu11count=3
submenu2count=4
submenu21count=3
submenu3count=4
submenu31count=3
The button of the menuitems simply has then 4 stages: 1.mainmenu; 2.submenu; 3.sub-submenu; 4.empty (just in case), depending on the state of the button that I will specufy with a variable. A text file with the variables is loaded to the swf and so I can change the menu items including the number of each menuitem. Good plan hah...? Or so I thought.
I'm having trouble with trying to build the menu so that when you click on one of the main menu buttons the other submenu (and sub-submenu) items close (smoothly) and move out of the way (smoothly - I don't want them to 'jump') for the active menu buttons. So how do I tell the menuitems that are duplicated movieclips of the buttons to move downwards acording to what menu has opened and the other ones that were previously opened to move upwards? Is there something like "noOverlap" function or something? Or do I just need to specify the x and y positions of the buttons (mc's). And how ould I make them move smoothly.
My mind hung up on me - please, any ideas...
Thanks a lot.
Frames & Dynamic Menus
Is there a way to program the dynamic links in a menu to call up an html page inside a different frame window when the menu is in? this is a dynamic menu with rubs & subrubs. I'm trying to get the subrubs to do the above (the code would be placed in the URLrub section). this is the way the code is set up:
HeightRub = getProperty("Rub", _height);
HSousRub = getProperty("SubRub", _height);
setProperty("Rub", _visible, 0);
setProperty("SubRub", _visible, 0);
setProperty("Bottom", _visible, 0);
setProperty("Border", _visible, 0);
// ------------------------------
// Modify your parameters here
// ------------------------------
ClosingSpeed = 10;
OpeningSpeed = 5;
TotalRubs = 7;
// ::::::::::::::::::::::::::::::::::::::::::::::::
LabelRub1 = "C a l h o u n P a r k";
TotalSousRubs_Rub1 = "1";
LabelRub1_subrub1 = "passion";
Frame_TargetRub1 = "main";
// ::::::::::::::::::::::::::::::::::::::::::::::::
LabelRub2 = "VISION";
TotalSousRub_Rub2 = "4";
LabelRub2_subrub1 = "passion";
URLrub2_subrub1 = onPress.getURL("Location.html", "content");
LabelRub2_subrub2 = "lead";
URLrub2_subrub2 = "";
LabelRub2_subrub3 = "niche";
LabelRub2_subrub4 = "arena";
URLrub2_subrub3 = "";
// ::::::::::::::::::::::::::::::::::::::::::::::::
LabelRub3 = "DREAMS & INTERPRETATIONS";
URLrub2 = "";
TotalSousRub_Rub3 = "2";
LabelRub3_subrub1 = "portfolio";
URLrub3_subrub1 = "";
LabelRub3_subrub2 = "case studies";
URLrub3_subrub2 = "";
// ::::::::::::::::::::::::::::::::::::::::::::::::
LabelRub4 = "COMMUNICATION";
URLrub3 = "";
TotalSousRub_Rub4 = "4";
LabelRub4_subrub1 = "campaign";
FrameTarget_Rub4_subrub1 = "try";
LabelRub4_subrub2 = "rich text email";
LabelRub4_subrub3 = "communication center";
URLrub4_subrub3 = "";
LabelRub4_subrub4 = "templates";
// ::::::::::::::::::::::::::::::::::::::::::::::::
LabelRub5 = "REACTION";
URLrub5 = "";
TotalSousRub_Rub5 = "3";
LabelRub5_subrub1 = "proposal request";
URLrub5_subrub1 = "";
LabelRub5_subrub2 = "material request";
LabelRub5_subrub3 = "other request";
// ::::::::::::::::::::::::::::::::::::::::::::::::
LabelRub6 = "CLIENT GATE";
TotalSousRub_Rub6 = "1";
LabelRub6_subrub1 = "project room";
// etc......
// ------------------------------
LabelRub7 = "";
Dynamic Scrolling Menus
I know how to create scrolling text, even scrolling text loaded from a txt file. What I don't know how to do is make a "scrollable menu" that also displays images along with text. Could anyone direct me to a tutorial on how to do this? Even better, how to make the arrows/scroll bar a custom image.
~Thankyou
Dynamic Menus In Flash Using Xml
Hi!!
I am trying to make horizontal dynamic menus using xml. But some how i am very confused with this concept. If anyone has made menus using xml pls do help me...
Creating Dynamic Menus
I 've been playing with popup menus all week, and thanks to the help of people on this board managed to create one and get it working. But now I'm getting greedy and trying to figure out how to create a dynamic one. I found an example fla (included below) that creates a menu from an array. However it only links to urls and not frames in the main movie. Can anyone help me out with this, I've tried to add an .onpress event to the button that is behind the text items of each menu item but this doesn't seem to work, tho I suspect this may be due to my lame coding .
I'm assuming that by removing the line:
Quote:
subMenu.sub_menu.link = subLink.split('#')[1]
I will get rid of the url link, however I need somehow to create an onpress (or other) event which will then let me move to another frame, so I tried:
Quote:
subMenu.onPress = function() {//on button press
_root.gotoAndStop(subMenu.sub_menu.txt);//goto frame in main scene
};
The idea being that the name of the menu item is also the name of the frame I wish to go to. However this doesn't seem to work.
I'd really appreciate any help or guidance.
Creating Dynamic Menus.
What I want to do is take an array of links and create a menu on the fly from it.
Basically, have a simple button, which displays the link text on it, and opens the link URL "onclick". Then create a new instance of it on the stage for each link in the array.
I would really appressiate it if someone could point me in the right direction!
Thanks,
Neil
Dynamic Menus With Effects
Hi,
I am having trouble working out exactly what is happening behind the scenes when dynamic menus/ submenus get displayed with some effect.
I am able to read in an xml file, create a menu, and display submenus with the use of a rollover event. The submenus appear immediately, all at once, with the execution of the rollover event. However i want the submenu items to appear with some effect.
For example, i would like the submenu to gradually appear smoothly as if growing out of the main menu. I apologize for my lack of correct terminology.
The main goal is is to have a long thin sidebar on the far right of my movie that when rolled over a bunch of thumbnails pop out (smoothly) from this location toward the center of the movie.
How should i be thinking about doing this?
Do you use masks? or is there something a little more sophisticated?
cheers
Andy
Generating Dynamic Menus
Hi there,
I'm a bit of a newbie here so forgive me if this is obvious.
What I'm trying to do is generate some a menu with submenus. The whole menu is driven by the data held in a txt file or something like that.
The data in the file might look something like:-
a_a_1
a_a_2
a_b_1
a_b_2
a_b_3
b_a_1
b_b_1
b_c_1
b_c_2
Hopefully you get the idea.
What I would like to do is read this data into an array. The menus would then be created and broken down into submenus.
For the above there would be two main menu options 'a' and 'b', under those would be submenus 'a','b','c' and under those, submenus 1,2,3. You get the idea. Each link would then take you off to a frame with a particular image on it, again this would come from the list.
Can anyone suggest and solutions or recommend any tutorials on this sort of thing.
Thanks in advance,
Nick
Dynamic Scroller Using Menus
Ok Novice here..
So i successfully followed the instructions to create a dynamic scroller.. now
lets say i have 5 menu options that when clicked, would put other text in the
same text box. In other words, if i clicked about us' the text from the kirupa.txt file would call ' about=yayaya' and put in the scrolling box.
i imagine id need to put an action script as an on.click or something.. but have no idea..
for ref: this is the default text that simply loads the text file:
loadText = new loadVars();
loadText.load("kirupa.txt"
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.kirupatext;
};
Dynamic Menus (Flash 8)
Hey, right i am looking to build an interactive menu which looks works something like this
http://www.flashkit.com/tutorials/Ac...-541/index.php does anyone have a more up to date version of something similar?
I have tried to follow this but it seems to make no sense!
Generating Dynamic Menus
Hi there,
I'm a bit of a newbie here so forgive me if this is obvious.
What I'm trying to do is generate some a menu with submenus. The whole menu is driven by the data held in a txt file or something like that.
The data in the file might look something like:-
a_a_1
a_a_2
a_b_1
a_b_2
a_b_3
b_a_1
b_b_1
b_c_1
b_c_2
Hopefully you get the idea.
What I would like to do is read this data into an array. The menus would then be created and broken down into submenus.
For the above there would be two main menu options 'a' and 'b', under those would be submenus 'a','b','c' and under those, submenus 1,2,3. You get the idea. Each link would then take you off to a frame with a particular image on it, again this would come from the list.
Can anyone suggest and solutions or recommend any tutorials on this sort of thing.
Thanks in advance,
Nick
Dynamic Scroller Using Menus
Ok Novice here..
So i successfully followed the instructions to create a dynamic scroller.. now
lets say i have 5 menu options that when clicked, would put other text in the
same text box. In other words, if i clicked about us' the text from the kirupa.txt file would call ' about=yayaya' and put in the scrolling box.
i imagine id need to put an action script as an on.click or something.. but have no idea..
for ref: this is the default text that simply loads the text file:
loadText = new loadVars();
loadText.load("kirupa.txt"
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.kirupatext;
};
[AS] Looking For A Tutorial: Dynamic Menus
Hi shock-friends,
I am trying to put together a dynamic menu system. The functionality that I am looking for is to have a menu system that generates sections, subsections, ect. based on variables coming from a server. I'll have to take a look at the ultrashock tutorials as well. Thanks if you have any suggestions.
--Xenite
Question With Dynamic Menus (Daafy's)
Here's the URL for the tutorial: http://www.flashkit.com/tutorials/Ac...41/index.shtml
In this tutorial, when you click on the links, it takes you to a URL. How do you make them to go to another frame in the movie?
Flash And Dynamic Drop Down Menus
i am combining a small flash file on a home page that appears below some dynamic drop down menus...the problem is that the flash file is covering up the drop downs....
what is the cause of this and is there a fix?
thanks
tom temple
Looking For Dynamic 'fake 3d' Text Menus
hi all, it's been a while since i last touched flash (3.0 or so), but i see amazing things being created, and since i have some free time now i wonder if anybody knows a *.fla or is while to share a *.fla that shows me how to create a 'fake 3d' menu, (and gets the data from extrenal sources). Here have a look at these site, they are what i'm lookin for (and which i unable to locate in the shared resources of flashkit)
(both click enter)
http://ezct.net/
http://www.lab-au.com/space/#
thx alot for any help
How To Make Dynamic Menus Slide In
Hello,
I've got the action script below to load an xml file with menu info. Everything at this point works, the menu drops down, everything is great. I would like to make it so the menu slides down, instead of just appears. I'm unsure of how to do this because the movie clip that contains the sub menus (subContain) is dynamically created.
Any ideas on how I can accomplish it?
Here is the actionscript:
Code:
//MENU CONFIG
cfg_XMLFile = "submen.xml"; //XML Filename
cfg_xMove = 125; //Menu Header x-axis move, Typical = width of movie clip
cfg_mcHeight = 25; //Height of Menu Header movie clip
cfg_mcWidth = 125; //Width of Menu Header movie clip
cfg_xStartPos = 75; //x coordinate of first Menu Header Clip
cfg_yStartPos = 15; //y coordinate of first Menu Header Clip
//END CONFIG
//####################################################
//START CODE
//XML Setup
menu = new XML();
menu.ignoreWhite = true;
menu.load(cfg_XMLFile); //Set xml file name in config section
//Function that assembles the menu
function menuCreate(xml, mcH, mcW, xpos, ypos, xMove){
//###MAIN MENU ITEMS
items = xml.firstChild.childNodes; //Gets menu headers from xml and puts into array "items"
for(a = 0; a<= items.length-1; a++){ //loop from 0 to number of items in array "items"
iattrib = items[a].attributes; //Collect current menu attributes into object
item = _root.attachMovie( "menuItem", "item"+a, a); //Use movie clip "menuItem" to create menu header
item.nametxt.text = iattrib.id; //Set dynamic text box "nametxt" of movie clip "menuItem" to menu name
//###SUB MENU ITEMS - CREATION
subs = xml.firstChild.childNodes[a].childNodes; //Get submenu items for array item #a and send to array "subs"
subContain = _root.createEmptyMovieClip("subContain"+a, a+1000); //Create movie clip to store all sub menu clips
for(z = 0; z<= subs.length-1; z++){ //loop from 0 to number of sub menu items for current main menu item
attribs = subs[z].attributes; //Set attribute items of sub menu to object "attribs"
sub =_root.subContain.attachMovie( "menuItem", "sub"+z, z+100); //Use movie clip "menuItem" to create submenu item
sub.nametxt.text = attribs.id; //Set dynamic text box "nametxt" of movie clip "menuItem" to menu name
sub._y = (mcH*z)+mcH; //Set the y position of the submenu item
sub.itemUrl = attribs.theURL //Set URL of submenu item
sub.onRelease = function(){ //If submenu item is clicked, open the URL
getURL(this.itemUrl, "_blank"); //Open URL in new window
}
}//CLOSE SUB MENU LOOP
//###SUB MENU ITEMS - OPERATION
//NOTE: Remember, subContain# contains all submenu movie clips, think of it as a drawer for multiple items
//x and y will be the same as the main menu item
_root["subContain"+a]._visible=false; //Hide submenu movie clip "subContain#"
_root["subContain"+a]._x = xpos; //Set x coordinate of "subContain#"
_root["subContain"+a]._y = ypos; //Set y coordinate of "subContain#"
item.num = a;
_root["item"+a].box.subsL = subs.length;
_root["item"+a].box.onRollOver = function(){
this._height = (this.subsL*mcH)+mcH+8;
}
//###MENU OPERATION, MOUSE TRACKING
_root["item"+a].onMouseMove = function(){ //When the mouse moves, track it
//Reference variables to the mouse coords
mY = _root._ymouse;
mX = _root._xmouse;
//Local reference to whether the subContain is hit or not
this.subHit = _root["subContain"+this.num].hitTest(mX, mY);
//SUBMENU APPEAR/DISAPPEAR
this.itemHit = this.box.hitTest(mX, mY); //If mouse is over "box" of clip "menuItem", show submenu
//NOTE: "box" expands to cover header and submenu items as long as mouse is moving over "box" the submenu stays open, else it closes
if(this.itemHit == true){
_root["subContain"+this.num]._visible = true;
}else{ //Mouse not over "box" anymore, hide submenu
_root["subContain"+this.num]._visible = false;
this.box._height = mcH; //resize "box" back to just cover menu header
}
}//CLOSE MOUSE TRACKING
//Place the menu item
item._x = xpos;
item._y = ypos;
xpos += xMove; //Move xpos over for next menu item (So they aren't on top of each other)
}//CLOSE MENU HEADER LOOP
}//CLOSE menuCreate FUNCTION
menu.onLoad = function(){
menuCreate(this, cfg_mcHeight, cfg_mcWidth, cfg_xStartPos, cfg_yStartPos, cfg_xMove, "menuItem");
}
The project is also attached.
Thank you!
Dynamic Menus And Button Presses
Hi,
New to the forum and I have set my self a new task. Learning dynaic menus properly.
I have worked on one which I am almost happy with but there are things wrong with it. (if anyone has any good tutorials or FLAs on this that would be great).
But my main problem is now simply just having a button so when you rollover it, it changes colour and when you click it it stays on that colour so you can see which button is currently active. How do people go about scripting buttons to work properly like this? I have this code but it runs into too many problems...
var my_color:Color = new Color(this);
my_color.setRGB(0x000000);
Any help would be great.
Dynamic Menus With Cool Effects
Hi,
I am having trouble working out exactly what is happening behind the scenes when dynamic menus/ submenus get displayed with some effect.
I am able to read in an xml file, create a menu, and display submenus with the use of a rollover event. The submenus appear immediately, all at once. However i would like the submenu items to appear with some effect.
For example,
http://www.vw.com/models_overview/index.html
The "models" button in the top left corner has the features i want.
1. With a mouse over i want a menu to appear. The first submenu item to be appear is the last on the list.
2. when the mouse drifts off the list, the submenu retracts in the same order it appeared.
How is this done? I do not want/expect any script. If anyone can explain the steps involved in creating such a menu i'd love it!
I've been messing around with this for days but i really dont understand what the concepts are
How should i be thinking about doing this?
Do you use masks? or is there something a little more sophisticated?
thanks
How To Make Dynamic Menus Slide In
Hello,
I've got the action script below to load an xml file with menu info. Everything at this point works, the menu drops down, everything is great. I would like to make it so the menu slides down, instead of just appears. I'm unsure of how to do this because the movie clip that contains the sub menus (subContain) is dynamically created.
Any ideas on how I can accomplish it?
Here is the actionscript:
Code:
//MENU CONFIG
cfg_XMLFile = "submen.xml"; //XML Filename
cfg_xMove = 125; //Menu Header x-axis move, Typical = width of movie clip
cfg_mcHeight = 25; //Height of Menu Header movie clip
cfg_mcWidth = 125; //Width of Menu Header movie clip
cfg_xStartPos = 75; //x coordinate of first Menu Header Clip
cfg_yStartPos = 15; //y coordinate of first Menu Header Clip
//END CONFIG
//####################################################
//START CODE
//XML Setup
menu = new XML();
menu.ignoreWhite = true;
menu.load(cfg_XMLFile); //Set xml file name in config section
//Function that assembles the menu
function menuCreate(xml, mcH, mcW, xpos, ypos, xMove){
//###MAIN MENU ITEMS
items = xml.firstChild.childNodes; //Gets menu headers from xml and puts into array "items"
for(a = 0; a<= items.length-1; a++){ //loop from 0 to number of items in array "items"
iattrib = items[a].attributes; //Collect current menu attributes into object
item = _root.attachMovie( "menuItem", "item"+a, a); //Use movie clip "menuItem" to create menu header
item.nametxt.text = iattrib.id; //Set dynamic text box "nametxt" of movie clip "menuItem" to menu name
//###SUB MENU ITEMS - CREATION
subs = xml.firstChild.childNodes[a].childNodes; //Get submenu items for array item #a and send to array "subs"
subContain = _root.createEmptyMovieClip("subContain"+a, a+1000); //Create movie clip to store all sub menu clips
for(z = 0; z<= subs.length-1; z++){ //loop from 0 to number of sub menu items for current main menu item
attribs = subs[z].attributes; //Set attribute items of sub menu to object "attribs"
sub =_root.subContain.attachMovie( "menuItem", "sub"+z, z+100); //Use movie clip "menuItem" to create submenu item
sub.nametxt.text = attribs.id; //Set dynamic text box "nametxt" of movie clip "menuItem" to menu name
sub._y = (mcH*z)+mcH; //Set the y position of the submenu item
sub.itemUrl = attribs.theURL //Set URL of submenu item
sub.onRelease = function(){ //If submenu item is clicked, open the URL
getURL(this.itemUrl, "_blank"); //Open URL in new window
}
}//CLOSE SUB MENU LOOP
//###SUB MENU ITEMS - OPERATION
//NOTE: Remember, subContain# contains all submenu movie clips, think of it as a drawer for multiple items
//x and y will be the same as the main menu item
_root["subContain"+a]._visible=false; //Hide submenu movie clip "subContain#"
_root["subContain"+a]._x = xpos; //Set x coordinate of "subContain#"
_root["subContain"+a]._y = ypos; //Set y coordinate of "subContain#"
item.num = a;
_root["item"+a].box.subsL = subs.length;
_root["item"+a].box.onRollOver = function(){
this._height = (this.subsL*mcH)+mcH+8;
}
//###MENU OPERATION, MOUSE TRACKING
_root["item"+a].onMouseMove = function(){ //When the mouse moves, track it
//Reference variables to the mouse coords
mY = _root._ymouse;
mX = _root._xmouse;
//Local reference to whether the subContain is hit or not
this.subHit = _root["subContain"+this.num].hitTest(mX, mY);
//SUBMENU APPEAR/DISAPPEAR
this.itemHit = this.box.hitTest(mX, mY); //If mouse is over "box" of clip "menuItem", show submenu
//NOTE: "box" expands to cover header and submenu items as long as mouse is moving over "box" the submenu stays open, else it closes
if(this.itemHit == true){
_root["subContain"+this.num]._visible = true;
}else{ //Mouse not over "box" anymore, hide submenu
_root["subContain"+this.num]._visible = false;
this.box._height = mcH; //resize "box" back to just cover menu header
}
}//CLOSE MOUSE TRACKING
//Place the menu item
item._x = xpos;
item._y = ypos;
xpos += xMove; //Move xpos over for next menu item (So they aren't on top of each other)
}//CLOSE MENU HEADER LOOP
}//CLOSE menuCreate FUNCTION
menu.onLoad = function(){
menuCreate(this, cfg_mcHeight, cfg_mcWidth, cfg_xStartPos, cfg_yStartPos, cfg_xMove, "menuItem");
}
The project is also attached.
Thank you!
How Do I Create Dynamic Menus In Flash?
I am creating my first flash website for my wife's cousin who is a photographer.
I want the site to be customizable by her through the use of XML, PHP, or whatever can get the following job done.
I want to create navigation buttons that are dynamically updated/created.
For example:
There will be a "Recent Sessions" button on the site. When the user clicks this I want it to show a drop down menu of all the names of the recent photo sessoins (like Smith Family is one option, Jackson family the other, etc). Well I want these subbuttons under the main Recent Sessions button to be created by the swf reading a file off the server (like the folder name a PHP file whatever). How can this be done?
Also say I want the buttons to animate in a special way (like squash and stretch when rolled over, etc). Do I create a template for the buttons in flash or through XML, etc can I have the sub buttons animate the way I want?
Thanks.
Dynamic Menus, For Loops, What Am I Missing?
I'm trying to get a dynamic menu sorted, all built from 2 symbols from the library. I'm using 3 for loops to attach the clips and set their intial positions etc which is working OK. The problem comes when I try to set certain btns position to accomodate the sub menus, I'm sure it's just something obivious I'm missing Math wise but can't for the life of me figure it out !!! (can't post an fla as I have'nt got FTP access here but will gladly email one over to someone). I really want this to be clever enough to accomodate any size of button / number of buttons without any need to rewrite the
Code:
builNav();
function so it's portable etc.
All you need to test the code is a main nav symbol with Linkage set to "btn_mc" and a sub nav btn with linkage "subBtn_mc"
Here's my code...
Code:
// define vars
var navTitles = new Array("INTERACTIVE", "PRINT", "ME", "LINKS", "CONTACT");
var subNav01Titles = new Array("SoundsWest.org", "Smile Creation", "Hyatt");
var subNav02Titles = new Array("Posters", "Ads", "Logos", "Misc");
// define functions
function buildNav() {
var startY = 10;
for (i=0; i<navTitles.length; i++) {
_root.attachMovie("btn_mc", ["btn"+i], this.depth++); // build main nav
_root["btn"+i]._x = 50;
_root["btn"+i]._y = (_root["btn"+(i-1)]._y+_root["btn"+i]._height)-1;
_root["btn"+i].origY = _root["btn"+i]._y;
_root["btn"+i].btnTxt_mc.btnTxt.text = _root.navTitles[i];
_root["btn"+i].onRollOver = function() {
};
_root["btn"+i].onRelease = _root["btn"+i+"func"];
}
_root.createEmptyMovieClip("subNav01", this.depth++); // create empty clip to hold sub nav 1
_root.subNav01._x = 50;
_root.subNav01._y = (_root.btn0._y + _root.subNavBtnHeight);
_root.subNav01._visible = false;
for (i=0; i<_root.subNav01Titles.length; i++) {
_root.subNav01.attachMovie("subBtn_mc", ["subBtn"+i], this.depth++);
_root.subNav01["subBtn"+i]._x = 0;
_root.subNav01["subBtn"+i]._y = (_root.subNav01["subBtn"+i]._height-1)*(i+1);
_root.subNav01["subBtn"+i].subBtnTxt_mc.btnTxt.text = _root.subNav01Titles[i];
_root.subNav01["subBtn"+i].onRollOver = function() {
};
_root.subNavBtnHeight = _root.subNav01["subBtn"+i]._height;
}
_root.createEmptyMovieClip("subNav02", this.depth++); // create empty clip to hold sub nav 2
_root.subNav02._x = 50;
_root.subNav02._y = (_root.btn1._y + _root.subNavBtnHeight);
_root.subNav02._visible = false;
for (i=0; i<_root.subNav02Titles.length; i++) {
_root.subNav02.attachMovie("subBtn_mc", ["subBtn"+i], this.depth++);
_root.subNav02["subBtn"+i]._x = 0;
_root.subNav02["subBtn"+i]._y = (_root.subNav02["subBtn"+i]._height-1)*(i+1);
_root.subNav02["subBtn"+i].subBtnTxt_mc.btnTxt.text = _root.subNav02Titles[i];
_root.subNav02["subBtn"+i].onRollOver = function() {
};
}
}
function btn0func() {
trace("btn0func's been called");
_root.subNav01._visible = true;
_root.subNav02._visible = false;
for (i=1; i<_root.navTitles.length; i++) {
_root["btn"+i]._y = ((_root.subNav01._y-1)+((_root.subNav01._height)+((_root["btn"+i]._height-1)*i)));
}
}
function btn1func() {
trace("btn1func's been called");
_root.subNav01._visible = false;
_root.subNav02._visible = true;
_root.btn1._y = _root.btn1.origY;
//_root.btn1.swingTo(_root.btn1._x, _root.btn1.origY, 0.4, 0.8, 0, 0);
for (i=2; i<_root.navTitles.length; i++) {
_root["btn"+i]._y = ((_root.subNav02._y-1)+((_root.subNav02._height)+((_root["btn"+i]._height-1)*i)));
}
}
buildNav();
Thanks,
Jon
Dynamic (html) Menus Over Flash Files?
Does anyone know how to get dynamic (html) menu dropdowns to appear on top of Flash files? Especially in older browsers (say 4.0 and above?) Thanks, rtwc
Generating Dynamic Menus From Text Files
Hi, I'm working on generating my menus from text files (for now until I learn XML) and I've got it done most of the way now. One problem I've got is that I'm trying to sort my list of projects in reverse order that it is now, it can be found here: http://www.ramsaystudios.ca/v5Dev/
There is a global menu and two local menus, those two load in white blobs on the right after a while, you'll see a list generate in each of them. The first one has a list of projects, I'm trying to get the opposite order that it is in now, so that it will read as "RamsayStudios v5" first and not last. My code is as follows:
Code:
slotHeight = 16;
for (i=0; i<=slotsLoaded; i++) {
menuContainer.attachMovie("menuItemContainer", "menuItemContainer"+i, i);
menuContainer["menuItemContainer"+i]._y = i*slotHeight;
menuContainer["menuItemContainer"+i].menuItem_clip.portfolioListItem_text = eval("portfolioListItem_text"+i);
menuContainer["menuItemContainer"+i].menuItem_clip.menuItem_button.onPress = function() {
getURL("portfolioListItem_url"+i);
};
}
I know you can change this line with adding the minus sign:
Code:
menuContainer["menuItemContainer"+i]._y = -i*slotHeight;
but that method then generates my list going upwards instead of downwards (I plan to put all this in a scrollbar later), is this the proper way to do it? If it is then I need to figure out how to reposition my menu accordingly. Please help, thanks.
Multiples Menus And Sub Menus
how can i add more menus and sub menus from this example?
ActionScript Code:
sub_menu._y = (30-sub_menu._height);Over = function () { onEnterFrame = function () { if (((this._xmouse>0 && this._xmouse<150) && this._ymouse>0) && this._ymouse<30) { delete this.onEnterFrame; Out(); sub_menu.tween("_y", 30, 1, "easeOutExpo"); } };};Out = function () { onEnterFrame = function () { if (((this._xmouse>0 && this._xmouse<150) && this._ymouse>0) && this._ymouse<sub_menu._height+30) { } else { delete this.onEnterFrame; Over(); sub_menu.tween("_y", (30-sub_menu._height), 1, "easeOutExpo"); } };};Over();
here is the .fla
Flash And Firefox Drop Down Menus - Menus Appear Behind Flash
Hi,
In firefox, if you browse to http://www.unitedpatients.co.uk/index.php and mouse over "What the Doctors Say" you will see that the drop down menu generated by Fireworks appears behind the Flash file on the right side of the page.
This was an issue in IE but was fixed by adding:
Code:
<param name="wmode" value="transparent">
Any ideas on doing something similar to make it work in Firefox (this also affects Safari on the mac)
Thanks in advance!
Scott
Pop-up Menus
Okay, here's the dilly. I'm trying to create a pop-up menu navigation and I'm not very savvy with action scripting. Right now, I have a menu of links and I want to create popup menus for each link. I'm guessing this is probably done with tell targets, but I've never used those before and I'm not sure how much I need to know. Can anyone point out a good tutorial or maybe even send me a file that I can work with?
Thanks,
Casey
Pop-up Menus..............please Help
hey.
I am relatively new to flash 5. i have made a pop-up navigation menu (ie; it says "menu" and when u click on it, it opens up to a full menu with options, and closes when u roll out). i can't seem to get any of the menu-buttons to go to a new scene...in fact, it changes to a new scene in the program (with frmae-actions on), but when exported it won't go anywhere. I really want to use a pop-up menu and can't make it work. how do i do it??? please help me (in simple terms)
thanks,
dSHOK
Pop Up Menus
Here my problem
I have a few pop up menus on my site each with their own buttons.
the pop up menus open prefectly but when one of the menu is open and i select another menu i want the one thats open to close
I would like to do this with actionscripting but am unsure of were to start and were to put the variables
If anyone could help me on this that would be great.
Thanks Malachai
Pop Up Menus
Here my problem
I have a few pop up menus on my site each with their own buttons.
the pop up menus open prefectly but when one of the menu is open and i select another menu i want the one thats open to close
I would like to do this with actionscripting but am unsure of were to start and were to put the variables
If anyone could help me on this that would be great.
Thanks Malachai
Menus
I've just started with Flash, and i'm in trouble with menus, how can I make them more dinamic, more colorful...pls mail me: ovidiu_cladoveanu@post.ro
Menus
ok..im trying to make scroll over buttons thats have a pop out menu that come out..but not on click..on ROLLOVER..and go back up when the mouse leaves the button..but when rolled over the pop down menu can be accesed without rolling back up..get it?help?
Menus
question. when making a pop on menu that occurs on a rollover..how do u make the menu stay open when the user scrolls over it
for flash 5
LO-O-O-Ong Menus
I've just about had it... I've searched everywhere, but can't find any info on this topic. Here goes...
Your Favourites menu in Internet Explorer has a scroll box at the bottom or top that scrolls the contents if they exceed the vertical limit of your screen.
I've been looking for a tutorial, or modification of a smart clip, or SOME hint or direction as to how to do this in Flash. I've tried using hit_tests, y_mouse, etc. to do this, but it never seems to work properly or seamlessly. If anyone out there has ANY hints as to how to produce a scrolling drop-down menu, PLEASE e-mail me. This has been plaguing me for a month now, and is integral to the project (thank god it's an open-ended one! ;-)
Thanks in advance... I bow to the experts for help...
Sean
XML Menus
Can someone point me in the right direction as to where to find a good tutorial on building XML menus within flash.
thanks
Menus :(
Can someone please help me, I've started a website, about mountain biking and bmx for my friends and I, and I decided to include a draggable menu, the only problem is, that the buttons in the menu don't do anything even after i've assigned scenes to them.
Pop Up Menus
I have followed Brett Taylor's Pop up Menus Tutorial and everything works fine. sub menus disappear and appear when they should, but when I place it on the stage and try to have the sub menus go to the their scene it doesn't work. I have checked the actions and they are ok.
I have action
on release
go to and play ("scene 1",1);
)
the second 1 is in black if that makes any difference.
Also when i click on one of the sub buttons the entire sub menu disappears unline Brett's which stay.
Any suggestions?
Thanks
Glenn
Menus
Hello,
I need to do the following:
when clicking on a button, a movie clip is played and stopped. the movie clip must not disapear...
any ideas how to do that ?(I have the button and the movie clip, but I dont know how to do a link between button and movie clip)
Pop Up Menus
I am following Brett's creating pop-up menus tutorial and everything runs smoothly except my pop-up buttons (or as he calls them subButtons) do not navigate to anywhere.
Is that because we make them 'Track as menu'.
I am sure it is very simple to do but I am fairly new to this and have to submit the site to a client.
So please help me out.
Thanks
Menus And Sub Menus
I need some examples of menus and submenus.
Like in the menu there will be items like Asia, Europe, North America...
When the mouse is rolled over the item Asia it will expand to Japan, China, Malaysia...
Thanks a lot.
FA
Pop Up Menus
hi,
i want to create a simple nav/pop up menu like this site:
www.jonelleweaver.com
i'm new and have no idea where to start! can anyone help?
thanks in advance!
|