Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Dynamic Menu Problem



1



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-11-2006, 09:55 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Dynamic Menu AS2.0/XML - Seperating Main Menu Title MC From Dropdown Item's MC
Hi everyone, this is my first post in this forum, I appreciate all the help

I've got a dynamic menu using AS2.0 that's being populated by an XML file, it's quite complete and is working fine, the only thing I'm having trouble with is assigning a new MC to the Titles so the visual design (Text and background) can be different from the rest of the dropdown menu.

What would have to be done to capture the menuNodes and isolate them form the rest. Below is the XML that I’m using, the highlighted (red, bold, italic) text below is what I’d like to capture and seperate from the rest of the submenus for the menu title in my flash project.

XML
----------------------------------------------
<?xml version="1.0"?>
<menu name="Atletas">
<menu name="Clubes">
<submenu name=""></submenu>
<submenu name="Botafogo">
<entry name="Player 1"/>
<entry name="Player 2"/>
<entry name="Player 3"/>
</submenu>
<submenu name="Flamengo">
<entry name="Player 1"/>
<entry name="Player 2"/>
<entry name="Player 3"/>
</submenu>
<submenu name="Flamengo">
<entry name="Player 1"/>
<entry name="Player 2"/>
<entry name="Player 3"/>
</submenu>
</menu>
<menu name="Atletas">
<submenu name="Gilberto"></submenu>
<submenu name="Jose"></submenu>
<submenu name="Joao"></submenu>
</menu>
<menu name="Posicoes">
<submenu name="Atacante">
<entry name="Gilberto"/>
</submenu>
<submenu name="Meio">
<entry name="Jose"/>
</submenu>
<submenu name="Zagueiro">
<entry name="Joao"/>
</submenu>
</menu>
</menu>
----------------------------------------------------------

attached is the screencapture of my flash design to understand what I'm talking about a little better.

Thanks for all the help

Flash Sliding Menu / Horizontal Dynamic Picture Menu
Hello,

I am quite fascinated by the effect used to scroll a variety of pictures left and right with the ability to halt on a particular picture to click and navigate to another area of a site. Could anyone point me to a tutorial on how this is done? An good example of the effect may be seen on this site:

http://www.calatrava.com (click on the "slide show" link)

Would appreciate any pointers. Thanks!

Flash Sliding Menu / Horizontal Dynamic Picture Menu
Hello,

I am quite fascinated by the effect used to scroll a variety of pictures left and right with the ability to halt on a particular picture to click and navigate to another area of a site. Could anyone point me to a tutorial on how this is done? An good example of the effect may be seen on this site:

http://www.calatrava.com (click on the "slide show" link)

Would appreciate any pointers. Thanks!

Creating Dynamic Sub Menu For Dynamic Menu
Hi,
I have created a dynamic menu by using nesting a button template in a movie clip & calling duplicateMovie() in the ActionScript involved. The button labels were created by passing values from an array that was declared in the ActionScript itself. Now if i want to create submenu for certain menu buttons, how can i go on doing that ?
I'm including the .fla file for reference.

Dynamic Menu Question - More Than 9 Items In Sub Menu
Greetings,

I'm trying to use a dynamic menu from an actionscripts.org tutorial.

However it will only allow a maximum of 9 sub menu items. I would like to use up to 20. I believe it involves this line of script:

this[name+n].choice = (i*10) + n;

How would I change the actionscript in this file to allow that?

Thanks in advance.

Here is the relevant script:

//initialize main menu
for (i=1; i<=_root.total; ++i) {
//duplicate movie clip
menuMC.duplicateMovieClip("menuMC"+i, i);
//set new position
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
this["menuMC"+i].choice = i;
//create a variable to record the levels of the created MCs
levelTrack = i;
}
//initialize submenu by creating and positioning movie clips
for (i=1; i<=_root.total; ++i) {
//check to see if the item has a submenu
if (_root["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_root["subText"+i]; ++n) {
levelTrack += 1;
subMenuMC.duplicateMovieClip(name+n, levelTrack);
this[name+n]._visible = false;
this[name+n].choice = (i*10) + n;
}
//position first submenu item under parent
this[name+1]._y = this["menuMC"+i]._y+this["menuMC"+i]._height;
//position rest of submenu items
for (n=2; n<=_root["subText"+i]; ++n) {
this[name+n]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
}
}
}

//hide all the submenu items and return the main menu items to their start position
function resetMenu() {
for (i=1; i<=_root.total; ++i) {
if (_root["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_root["subText"+i]; ++n) {
this[name+n]._visible = false;
}
}
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
}
}
// called by clicking the main menu buttons, this shows the submenu and moves the main menu buttons to give them space
function submenuShow() {
resetMenu();
if (_root["subText"+choice]>=1) {
name = "stext"+choice;
for (n=1; n<=_root["subText"+choice]; ++n) {
this[name+n]._visible = true;
}
this["menuMC"+(choice+1)]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
for (i=choice+2; i<=_root.total; ++i) {
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
}
}
}

Dynamic Text Fields In A Dynamic Menu
Anyone can advise how to give names(i.e home,service...) for textfields in a dynamic drop down menu instead of getting the original sequence (ie. text0,text1,text2) or button1,button2,etc...Help please

Dynamic Buttons For A Dynamic Menu - Flash_8
Hello,

I have to prepare a dynamic menu in actionscript that read the name of the button and the colour from a database in Mysql. I used amfphp to achieve the last part.

I would like to generate the button with the text and its colour get from the database. (The background of the button is gray, there is a little vectorial logo and a text that should be of the given colour, i.e. a gray button with the green logo and the green text, a gray button with the red logo and the red text, and so on).
The rollover should be of the same colour of the text, but the logo and text should become white.

Is it possible to create a movie I could change colour parameters (for text, vectorial logo and rollover)? Or may I create the button from scratch using entirely actionscript? Is there a guide or a tutorial for that?

Thank you in advance for all your help!

Dynamic Link Inside Of Dynamic Menu
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.

ActionScript 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.

Flash Dynamic Menu W/ Dynamic Content
I have been working on this project for school where when you run the flash on a server it uses loadvariables() to open a php file that lists all of the text files of a directory 'pages' in variable format for flash to build a button per text file. To clarify:

/pages
-home.txt
-tuts.txt
-links.txt

flash builds buttons for each of these above files with the button named after the text file name (minus the .txt).

This works just fine but what I want to do now is say, when you click the home button, it will load the contents of pages/home.txt into a dynamic text box. Or when you click the pages/tuts.txt it loads that, etc.

So far, I can get the text box to display the location of the text file based on what button you pushed but i cant get it to display the text that is in the text file. I know that i am inches away from finishing it but I can't seem to figure out where to place what code. I've tried many dynamic text tutorials and none seem to go into detail about stuff like this. They all just talk about a text box and loadvar's in the same frame in the same mc, etc.

If anyone can give me some help, I would greatly appreciate it. Thanks.

Here is my working example. http://mungyun.com/experiments/close/dyn_menu.html

here is a zip file with my work to this point. You need a php enabled server to get this to work.
http://mungyun.com/dynmenu.zip

Dynamic Menu With Dynamic Content
I really didn't know what to put as the title...

I have been working on this project for school where when you run the flash on a server it uses loadvariables() to open a php file that lists all of the text files of a directory 'pages' in variable format for flash to build a button per text file. To clarify:

/pages
-home.txt
-tuts.txt
-links.txt

flash builds buttons for each of these above files with the button named after the text file name (minus the .txt).

This works just fine but what I want to do now is say, when you click the home button, it will load the contents of pages/home.txt into a dynamic text box. Or when you click the pages/tuts.txt it loads that, etc.

So far, I can get the text box to display the location of the text file based on what button you pushed but i cant get it to display the text that is in the text file. I know that i am inches away from finishing it but I can't seem to figure out where to place what code. I've tried many dynamic text tutorials and none seem to go into detail about stuff like this. They all just talk about a text box and loadvar's in the same frame in the same mc, etc.

If anyone can give me some help, I would greatly appreciate it. Thanks.

Here is my working example. http://mungyun.com/experiments/close/dyn_menu.html

here is a zip file with my work to this point. You need a php enabled server to get this to work.
http://mungyun.com/dynmenu.zip

Dynamic Menu - Add Next Menu(s)?
I have a dynamic menu with one menu item and a few submenu items that works. Where and how do I add a second, third, ... menu and submenus to fall underneath the first menu?

My code is:
menu = new Array();
menu[0] = "Submenu";
menu[1] = "Submenu";
menu[2] = "Submenu";
menu[3] = "Submenu";
menu[4] = "Submenu";
menu[5] = "Submenu";
mtext = menu[3];
// movie clip for menu
this.createEmptyMovieClip("menuClip", 1);
menuClip._visible = false;
cDepth = 0;
// attach mpiece
menuClip.attachMovie("mpiece", "top", ++cDepth);
menuClip.top.useHandCursor = false;
menuClip.top.onPress = function () {
menuClip.startDrag();
}
menuClip.top.onRelease = function () {
menuClip.stopDrag();
}
menuClip.top.onReleaseOutside = function () {
menuClip.stopDrag();
}
menuClip.top.mtext = "Menu";

I set the background color and text color

for (var i=0; i<menu.length; i++) {
menuClip.attachMovie("mpiece", "item"+i, ++cDepth);
menuClip["item"+i].mtext = menu[i];
menuClip["item"+i]._y = menuClip.top._height + menuClip["item"+i]._height*i;
menuClip["item"+i].useHandCursor = false;
menuClip["item"+i].onRollOver = function () {
this.t.backgroundColor = 0xCCCCCC;
this.t.textColor = 0x000000;
}
menuClip["item"+i].onRollOut = function () {
this.t.backgroundColor = 0xFFFFFF;
this.t.textColor = 0x000000;
}
}
I attach a min max button and that's it.

Much appreciation for some help.

Y-Y

Dynamic Menu/sub Menu
First off, hello. Nice to meet you and its great to have this resource.

I sound like I'm at an AA meeting...

Ok, down to business. I've used the tutorial on this site for a dynamic menu/sub menu and its great (thanks Lesley). I've added one function to it - the main menu buttons also have a destination attached. However, I'm stuck with using scenes at the moment and the menu doesn't work quite how I want it to when using it in this way.

When a menu button is clicked, I want it to take me to the destination and to stay open and display the sub-menu items (like Windows Explorer). But what's happening is, although I am taken to the destination, the menu closes and has to be re-clicked to open it up.

I know this must be fairly elementary. Do I need to assign another variable? If so where do I assign it and where do I call it?

Many thanks for your help in advance

Dynamic Menu
Please URGENT....help me...

I want to create a "Dynamic Menu" with 4 level sub menu...
Could somebody help me? ... I need it in flash 4, if not possible that's ok could be flash 5.

P.S. I need it will be read a external file txt

So, I'll be very thankful

Edson
[Edited by Edson on 06-20-2001 at 09:14 PM]

Dynamic Menu
Hey gang,
I am looking for a good source for making a dynamic content created drop down menu. I found the one listed in the tutorials but I have had no luck in contacting the writer. I am a novice at the action scripting. I went throught the tutorial and I need a .swf file to get a better grip on it. I need to find this info so that I can get started on a project. I am looking for a lead or even a .SWF file that will visually assist me in putting it together.
Thanks for your help,
J

Dynamic Menu
Hey guys,

I'm trying to create a dynamic menu system, and I was trying to do it without the aid of anyone or anything, but thats not gonna happen. I need some help.

I have a movieclip with an instance name of menu0. The on the first frame of the flash movie I have this code.

spacing = 11;
number = 5;
for (i=1; i<number; i++) {
menu0.duplicateMovieClip("menu"+i, i);
setProperty ("menu"+i, _y, getProperty(_root.menu0, _y)+(spacing*(i)));
}

Now I know I can shorten the setProperty line, but that can be done later.
So far this will duplicate the movie 5 times and align them correctly. Now I need to get the dynamic variables worked out.

In the movieclip there is a variable called menutext. I am trying to write up a text file that will display what each menutext will say.

Right now Im having problems with getting any text to show up in the menutext variable.

I hope this all makes sense. Should the variable in the movieclip be "menutext"+_root.i, instead of just menutext or something like that?

I have seen a tutorial that sets menutext to "menutext" + i, but I dont know if that would work. It seems as if it is setting every variable to menutext5.

anyways, help.

dduck1934

Dynamic Menu
Her is the problem, I have the menu and I need to link to the relevant section in the section movie clip.

But I need to set up a dynamic text field so that I can link to the correct section.

This will all make sense when you see the file.
Try to make each button link to the correct section and you will see my problem.

http://www.aftereden.co.uk/flashkit/menu_problem.zip

thanks

Best Way To Set Up My Dynamic Menu?
Please have the patience to read this whole entry!

I'm setting up a menu that works like this:

When a button is clicked on the menu (the menu is horizontal), the contents of the homepage (below the menu) scrolls down off the page, then the contents of the appropriate page scrolls up to take it's place.

Depending on which button is clicked, I need to play the appropriate portion of a MC. For example, if I'm on the homepage and click the 'Contact' button, I need to start playing the frame labeled 'down' in the 'Home' MC. After these frames have played, I need to jump to the 'up' portion of the 'Contact' MC, so that is scrolls up and replaces the homepage clip.

I already know how to use 'with' to target a MC. That's not the problem. What I need to know is if I should start out with all the MC's on the main timeline, and set the _visible property according to which one I'll be using, or if I need to scrap this idea and just use the 'loadMovie' action?

Please give input!!

Dynamic Menu
i have to create a dynamic menu, actually is a pulldown choice menu.
first problem is that i don't know hom many items will be featured in this menu, they will be captured from a database.
second problem is that every item has to send some parameters to a .asp page and give some actions to the flash movie.
how can i manage all this?
i was workin' with a "for" action creatin' a cicle to duplicate a button but i can't get anything to work

can someone please help me... : )

ciao

Dynamic Menu HELP
I am trying to add a dynamic menu from this tutorial: http://www.flashkit.com/tutorials/Ac...41/more3.shtml

My problem is that i cant figure out how to add a ELSE statement in the action script as shown below. I have Flash 4.

We define here the future position of our dupplicated movies
Set Variable: "YPosition" = 30
Else
Set Variable: "YPosition" = GetProperty (n-1, _y) + RubHeight
End If
At last, we set our "YPosition" var to our dupplicated movie
Set Property (n, Y Position) = YPosition

TIA for any help,
Marvin

Plz.. Help Me With A Dynamic Menu..
Well...
i have a simple layout with a dynamic menu.. and that is the problem:
I have 4 options, and 5 "subOption" at each one...
so, i want have access from anyone to anyone...
the only solution that I found was make billions of movie clips , one for each possibility
...
iknow tha was dull.. if any one to be able me to help...

Tanx!!

Dynamic Menu From PHP
Hi there. I was wondering how to get a dynamic menu with db driven items.
I made a generic item object 'item' with a 'dynamic text' field named 'text'.
what i'd like to do is loading a set of variables named name1, name2, ..., nameN and generate a menu with a set of 'item' instances each loading the proper value of 'text' field.
anybody knows how to? or anyody knows a tutorial about this?
Bye and thanx in advance

Dynamic Nav Menu
I downloaded this source file for a dynamic nav menu system and am wondering how it works as far as when someone clicks on the buttons(jpegs) where is the AS that takes them to another frame/scene/movie? I am new to AS and am trying to learn it. This is a very cool site if you have not checked it out yet it is really sweet! Here are the links to the site and the source file I am talking about. Thanks for the help! TC

http://www.mjau-mjau.com/tanmenu/tansource.fla
http://www.mjau-mjau.com

Dynamic Xml Menu
I'm writing an xml-driven popup menu in flash, and I want the xml file to contain the menu nodes, so the menu should be flexible enough to handle a varying amount of nodes. I have a movie clip with a dynamic textfield in it, which is going to display the menu label. Now, I thought that I could duplicate the movie clip on the fly (duplicateMovie() I guess). But how do I alter the menu labels? There's no deal about the first one, which I can access straight through the variable I assigned it to, but how about the others? They'd all be linked to the same variable, wouldn't they? Is there anything in the flash object model I can use to access the textfields within the duplicated Menu nodes? Or at least change the variable they're referring to?

Dynamic Menu
can anyone look at this code and tell me the wrong part? Especially, I'm not sure what to put beside the loop while.

n = 0;
while (<not set yet>) {
set("PosY" add n, getProperty(n,_y)+RubHeight);
if (TargetRub == n) {
//
z = 0;
while (<not set yet>) {
duplicateMovieClip("Subrub", TargetRub&"_"&z, (TargetRub*10)+z);
if (z==1) {
YPosition = getProperty(n,_y)+(RubHeight/2)+(SubrubHeight/2);
} else {
YPosition = getProperty(TargetRub add "_" add (z-1),_y)+SubrubHeight;
}
}
setProperty(TargetRub add "_" add z, _y, YPosition);
set(TargetRub add "_" add z add ":Label", eval ("LabelRub" add n add "_Subrub" add z));
}
MaxDistance = eval("Total_Subrubs_Rub" add TargetRub)*SubrubHeight;
//
set("Distance"&n, eval("Distance" add n)+5);
if (eval ("Distance" add n)>=MaxDistance) {
set("Distance" add n, MaxDistance);
} else {
z = 10;
while (z>0) {
z = z-1;
removeMovieClip(n add "_" add z);
}
set("Distance"&n, eval("Distance" add n)-10);
if (eval ("Distance" add n)<=0) {
set("Distance"&n, 0);
}
}
setProperty(n+1, _y, eval("PosY" add n)+eval("Distance" add n));
}

Dynamic Menu In MX
Hey,

I have a text file which contains a variable, 'items', which tells the movie how many text fields to display. I have loaded the variable into the movie, now how do I get this variable to display the (X) amount of text fields??????

Someone pleeeease help!?!

Dynamic Menu In Dynamic Menu
I have a dynamic menu ... so only one example which is used for all submenus ... but i need to create another subsubmenu... is it possible to do this ?

If so do you know how or do you have an example ?

Thx in advance

Didier

Dynamic Menu
could someone lead me to a tutorial to create dynamic menus on Flash MX 9not Flash 5)
i seached FK but there are only flash 5 tutorias

Dynamic Menu Help
my buttons are not linking correctly..

The first button work does not find the loadmovie swf. all the other buttons work. I can't figure out why the first button will not work

here is my fla file

http://www.punkrockvideos.com/youngheartattack/menu.fla

menu.swf (main)
work.swf (button)
resume.swf (button)

thx

george

Dynamic Menu Help
Need some help in creating a dynamic menu- there's a killer tutorial (http://www.flashkit.com/tutorials/Actionscripting/Expert/Very_Hig-_Da-541/index.shtml) demonstrating the effect I want, but the author's english isn't quite there and I can't figure out the right way to do this... Any ideas?

Dynamic Menu
I'm trying to create a menu with actionscript.

This code is in another language so I don't completely understand. IF someone is experienced in actionscripting would you please help.

IF you could break this down to a simpler example or explain what is happening because I don't have a clear picture of how to do this effect.

What I'm trying to do is if you have 4 vertical buttons when you click on the top button it reveals a submenu below that button and buttons 2,3,4 drop below buttons 1 submenu. The menu would collapes and expend depending on what button you click.

Here is what I have.

This code is in the main time line
Functions:---------------------------

nivelUno = [boton0, boton1, boton2, boton3, boton4];
subMenus = [sub0, sub1, sub2, sub3, sub4];
sub0 = ['cero 0', 'cero 1'];
sub1 = ['uno 0', 'uno 1', 'uno 2', 'uno 3'];
sub2 = ['dos 0', 'dos 1', 'dos 2'];
sub3 = ['tres 0', "tres 1", "tres 2"];
sub4 = ['cuatro 0', 'cuatro 1', 'cuatro 2'];
pos = []
operador = []
// ----------------------------------------------------------------------------------------------------------

//
// ----------------------------------------------------------------------------------------------------------
function ordenar (nombre, desplazamiento, nivel) {
// ::::::::::::::::::::
for (i=0; i<7; i++) {
if (eval(nombre) == nivelUno) {
_root.nivelUno.click = false;
} else {
_root.nivelUno.click = true;
}
}
// ::::::::::::::::::::
for (i=0; i<7; i++) {
if (i<6) {
_root.nivelUno.ypos = _root.nivelUno.yinit;
}
}
// ::::::::::::::::::::
_root.ordenados = false;
for (i=0; i<6; i++) {
if (_root.nivelUno._x != _root.nivelUno.yinit) {
_root.ordenados = true;
}
}
// ::::::::::::::::::::
if (_root.ordenados) {
for (i=nivel; i<7; i++) {
if (eval(nombre) == nivelUno) {
} else {
_root.nivelUno.ypos = _root.nivelUno.yinit+_root.nivelUno._height+12*des plazamiento;
}
}
}
// colocamos y visualizamos el menu correspondiente
_root.subMenus[nivel]._y = Math.round(_root.pos[nivel]+_root.SubMenus[nivel]._height/_root.operador[nivel]);
if (_root.ordenados) {
for (i=0; i<5; i++) {
if (_root.subMenus == _root.subMenus[nivel]) {
_root.subMenus.activar = true;
} else {
_root.subMenus.activar = false;
}
}
}
}

This code is also in the main time line
Some more code:---------------------------

Movieclip.prototype.mov = mov;
function mov () {
this.pos = _y
//::::::::::::::::::::::::::::::::::
if(this._y == this.yinit){
this.posicion = true
} else {
this.posicion = false
}
//::::::::::::::::::::::::::::::::::
this._y += Math.round ((this.ypos-this._y)/4);
}

Code on the MC:---------------------------

onClipEvent (load) {
desplazamiento = _root.sub0.length;
yinit = this._y;
ypos = yinit
click = true
nivel = 0
}
onClipEvent (enterFrame) {
this.mov();
}

Code inside the MC:---------------------------

on (release) {
if (this.click) {
_root.ordenar(this._name, this.desplazamiento, this.nivel);
}
}

------------------------------------------------------

Help On Dynamic Menu
Hi to all,
i am trying on a tutorial on dynamic menu which can be found on this page: http://www.flashkit.com/tutorials/Ac...-541/index.php
I've been trying to follow for a week, I still dont seems to get it right, the site doesnt included a .fla file which i can compare. Wondering anyone can help me or if u have something similar which i can refer to or a .fla file. Thanx and appreciated. Note: i am using Flash MX

Dynamic Menu Thru As
could somebody provide the codes of great dynamic menus in flash ,,
and also i wanna make a stuff like thing,,

i wanna play animation in a mc "ft" when the mouse moves out of restricted area something like

www.8edge.com

some help would be great

thank you

Dynamic Menu
I have created a dynamic menu system but the problem is in the scroll system. It works right now with the amount of buttons that are generated from the dressArray=[] but if you change the amount in the dress arry then the scroll is all messed.Can someone please take the time to look through this. I sectioned out the scroll section with comment tags.
I need it to stop scrolling if it is gone past its bounds. Which is gotten from a getBounds();
Please help with this. Thanks

Dynamic Menu
How to make a dynamic menu system play a movie clip?

Dynamic Menu MC
Im in a bit of dilema.. in need ideally a dynamic menu that'll still work once inside a MC.
Im trying XML but having a nightmare getting my head around it.
Does any1 know of any??

Dynamic Menu
Using Flash MX, need help with the following menu:
http://www.flashkit.com/jump.php?ID=8032&type=movies

In the actionscript code there is a "links" line where you can put a url for a menu item
eg. links[0]="http://digilander.iol.it/mywebhost/flash";

I want to put a loadMovie command instead of a url, how do I do that?
eg. loadMovie("test.swf", "mainarea");

Is there a better menu out there that could do this?

Thx

Using Dynamic Menu For CD
Hi...I need your help

I have a client who wants to create multipule CD modules...I've decided that the interface navigation should be completely dynamic for ease of updating new CDs.

I found an FLA that shows how to duplicate the buttons and sub buttons and how to attach field names to them. This works great...but, I'm having trouble figuring out what action to apply to the original sub button to target a external swf that will be loaded into a host clip on the root level.

The original FLA that I downloaded had a getURL action on it...I DON'T want to pull up the browser window or any urls. I want to target an external swf and load it into a host clip on the root level. Thats it.

So, what should I put in the field for the links array? There are 24 sub page links in the array... Should it look like this, on one of them:

links=new Array();
links[0]="intro.swf"

If not, how should I tell the link [#] that it is to pull up a particular swf?

And on the original sub button, that is duplicated 24 different times...I need a GENERAL action that will tell the button which link [#] it is, and pull up appropriate external swf ... Remember, there are 24 different links that this button represents, I can't use a specific action like: loadMovie("subpage_mc, "intro.swf); it needs to apply to any of the sub buttons..l

This is what I have on the button right now...and It won't work.
on(release){
_root.subpages_mc.loadMovie(links,"");
}
I'm pretty sure part of the problem is the " "...but I don't know to work around having to give it a specific swf.

Someone sent me this in another forum...but It didn't work either:

on(release){
getURL(link,window,variables)
// or you can load(loadMovie(link,""))
}
Please help...I am VERY stuck and would GREATLY appreciate your help.

If you need any more information, let me know

Jenny

Dynamic Menu
I'm trying to program certain effects for a dynamic menu, everything works fine except for one thing: I want the selected button to keep a different look and reset it when another button is clicked.

It works for the main categories, but not for the sub-categories.

Here is the code used for the categories:

on (press) {
//---to reset the alpha once another button is clicked:
_root.boutonSelect._alpha = 80;
}
on (release) {
// to define the position of the sub-cats
../:TargetCat = _name;
//--------------------
//transferring the identity of the selected button to reset it later
_root.boutonSelect = this;
trace (_root.boutonSelect);
//transform the alpha
this._alpha = 1000;
}

Like I said, this code works fine for the main categories and the code for the sub-categories is exactly the same, except for the "../:TargetCat = _name;" since I don't have to call another level under it. When I trace the categories, the instance name looks like this: _level0.instance11.1
and the sub-cats: _level0.instance11.1_1

Does someone have an idea???
I use Flash MX

Thank you for your help!

Dynamic Menu In MX
Hi..

I have a menu that is dynamically produced from an xml doc..

I want to have rollovers on the movie clips that are asking as buttons..(simply making into buttons stops it from working)..

I can code the rollover effect in the function that creats the menu but it will only work for one instance..

What I need to do is address all of the instances that have been placed on the stage…

Can anyone help?

Thanks..

Dynamic Menu In F5
I need something similar to the flyout hierarchal menus you've seen with javascript, only in flash 5. Plus, they have to be dynamic.

I have several main navigation buttons, and when you roll over them, a rectangular shaped submenu will fly out. I need that submenu to be populated from a text file. So, not only will the contents of the submenu change based on the text file contents, but the size of the submenu box will change based on how many submenu items there are. I hope I am explaining this clearly. If not, let me know.

I know how to load data from a text file and drop it into a button, but I can't figure out how to generate the number of buttons I need, and place them in an ordered way, based on the total number of submenus, which will change.

This might be better off being a javascript/PHP thing, but the client really wants me to try flash.

Any ideas?

Thanks, Dan

Dynamic Menu
I was trying to create one of these off of a tutorial here. But I can't seem to get it to work. The link is:

http://www.flashkit.com/tutorials/Ac...-541/index.php

Does anyone have something close to this, and maybe I could take a look at your .fla?

The author didn't include one so I can't find my errors.

Dynamic Menu's
how can i make a dynamic menu that will open sub menu's by reading(or based) on outside params or on xml?
does any 1 have an example for that?(in fla file)?
10X
in advance
Peleg

Dynamic Menu
Is this possible to build with flash? If yes how?

http://www.wissen.de/xt/default.do?MENUNAME=Matrix

Thanks

Dynamic Menu
Hi

I am trying to modify this fla that I came across here.

I have been unsuccessful in trying to get the submenus to
goto the particular frames within the movie.

Any help much appreciated

file attched:

thanks

D

Dynamic Menu
I am trying to create a menu alot like macromedia used on the first update of their site. (it was changed pretty quickly to another style)

The menu is also reminicent of the three column list view in the mac os. you are presented with a list of options, each option has another list.. etc.

I have thought about this quite a bit, and it seems I am going to have to play with multidimensional arrays.

what are your thoughts?

Dynamic Menu
Hi,

I'm trying to use this wonderful piece of flash, found here but i'm unable to modify it completely.

When you click on a button, it fetches an url for you. Nice, but i want to do the entire site in flash and want to modify it so that it points to a movieclip (+label) instead of an url.

I'm sure this is possible, i just don't know how Any advice on this would be very welcome. I'm using FlashMX 2004 and i have to say that i'm fairly new to actionscripting (but learning quickly).

Thanks in advance!

Here's a piece of the code. I hope this is the part where the properties for the buttons are set:


Code:
// -------------------Here is the dupplication part
call("remove");
setProperty("Up", _y, "1");
n = 0;
while (Number(n)<Number(TotalRubs)) {
n = Number(n)+1;
duplicateMovieClip("Rub", n, n*10);
if (Number(n) == 1) {
setProperty(n, _y, Number(getProperty("Top", _y))+Number(getProperty("Top", _height))-0.7);
} else {
setProperty(n, _y, Number(getProperty((n-1), _y))+Number(HeightRub)-10.7);
}
set(n add ":Label", eval ("LabelRub" add n));
set(n add ":URL", eval ("URLrub" add n));
set(n add ":Frame_Target", eval ("Frame_TargetRub" add n add "-subrub" add z));
if (eval ("Frame_TargetRub" add n) eq "") {
set(n add ":Frame_Target", "_top");
}
// -------------------------------------
z = 0;
while (z < eval ("TotalSousRub_Rub" add n)) {
z = Number(z)+1;
duplicateMovieClip("SubRub", n add "-" add z, Number((n*10))+Number(z));
if (Number(z) == 1) {
setProperty(n add "-" add z, _y, Number(getProperty(n, _y))+Number(HeightRub)-10.7);
} else {
setProperty(n add "-" add z, _y, getProperty (n add "-" add (z-1),_y)+ HSousRub);
}
set(n add "-" add z add ":Label_sousrub", eval ("LabelRub" add n add "_subrub" add z));
set(n add "-" add z add ":URL", eval ("URLrub" add n add "_subrub" add z));
set(n add "-" add z add ":Frame_Target", eval ("Frame_TargetRub" add n add "-subrub" add z));
if (eval ("Frame_TargetRub" add n add "-subrub" add z) eq "") {
set(n add "-" add z add ":Frame_Target", "_top");
}
}
}
duplicateMovieClip("Bottom", Number(TotalRubs)+1, (Number(TotalRubs)+1)*10);
setProperty(Number(TotalRubs)+1, _y, Number(getProperty(TotalRubs, _y))+Number(HeightRub)-10.7);
duplicateMovieClip("Border", Border2, 250);

Help With Dynamic Menu
Can anyone please help me out here?

I've got a php script outputting values link and label in XML format, which is working fine, and I'm trying to get this actionscript to create a dynimic menu - trouble is it ain't workin!

Here's the code

//Load XML
myXml = new XML();

//ignore white space XML
myXML.ignoreWhite = true;

//Load XML file into XML object
myXML.load ("menu.php");

// Check XML file loaded successfully
function handleLoad(status) {
status ? makeMenu() : trace("Error parsing XML.");
}
myXML.onLoad = handleLoad;

//Build buttons
function makeMenu(){

//Linkage Name of button clip
myItem = "button";
//Initial x pos
myX = 0;
//Initial y pos
myY = 10;

//Goto first button node and count the no of button nodes
for (i=0; i<myXML.firstChild.childNodes.length; i++) {
//Get id value of button and assign to title var
title = (myXML.firstChild.childNodes[i].attributes.label);
//link
link = (myXML.firstChild.childNodes[i].attributes.link);

this.attachMovie(myItem, title, i+10);
thisItem = this[title];

thisItem.title = (title);

thisItem.X_ = myX+= (thisItem._width)+2;
thisItem.Y_ = myY;

thisItem.onRelease = function(){
openLink(this.link)
}
}
}

Any suggestions would be greatly appreciated!

Here's the php

<?
$connection = mysql_connect("localhost","***","***") or die ("connection didn't work");

$db = @mysql_select_db ("***",$connection) or die ("couldn't connect to db");

$sql = "select * from menu";

$result = @mysql_query($sql,$connection) or die ("couldn't do query");

echo "<?xml version="1.0" encoding="iso-8859-1"?>";

echo"<XMLmenu>";

while ($row = mysql_fetch_array ($result)) {

$label = $row['label'];

$link = $row['link'];

echo "<button label="$label" link="$link"></button>";
}
echo"</XMLmenu>";

?>

Thank's in advance!

Dynamic Menu, Please Help
Help with dynamic menu
Can anyone please help me out here?

I've got a php script outputting values link and label in XML format, which is working fine, and I'm trying to get this actionscript to create a dynimic menu - trouble is it ain't workin!

Here's the code

//Load XML
myXml = new XML();

//ignore white space XML
myXML.ignoreWhite = true;

//Load XML file into XML object
myXML.load ("menu.php");

// Check XML file loaded successfully
function handleLoad(status) {
status ? makeMenu() : trace("Error parsing XML.");
}
myXML.onLoad = handleLoad;

//Build buttons
function makeMenu(){

//Linkage Name of button clip
myItem = "button";
//Initial x pos
myX = 0;
//Initial y pos
myY = 10;

//Goto first button node and count the no of button nodes
for (i=0; i<myXML.firstChild.childNodes.length; i++) {
//Get id value of button and assign to title var
title = (myXML.firstChild.childNodes[i].attributes.label);
//link
link = (myXML.firstChild.childNodes[i].attributes.link);

this.attachMovie(myItem, title, i+10);
thisItem = this[title];

thisItem.title = (title);

thisItem.X_ = myX+= (thisItem._width)+2;
thisItem.Y_ = myY;

thisItem.onRelease = function(){
openLink(this.link)
}
}
}

Any suggestions would be greatly appreciated!

Here's the php

<?
$connection = mysql_connect("localhost","***","***") or die ("connection didn't work");

$db = @mysql_select_db ("***",$connection) or die ("couldn't connect to db");

$sql = "select * from menu";

$result = @mysql_query($sql,$connection) or die ("couldn't do query");

echo "<?xml version="1.0" encoding="iso-8859-1"?>";

echo"<XMLmenu>";

while ($row = mysql_fetch_array ($result)) {

$label = $row['label'];

$link = $row['link'];

echo "<button label="$label" link="$link"></button>";
}
echo"</XMLmenu>";

?>


If anyone could help me out here, I'd greatly appreciate it.

Help With Dynamic Menu
Im having some trouble getting my menu to work. I want to get the value in the array "subMenu" to show up in the movie clip.


Code:
function info(myVar) {
MyLoadVars = new LoadVars();
MyLoadVars.load("CdTypes/"+myVar+"WEB MAKEOVER.txt");
//////////////////////// LOAD MENU NAMES ///////////////////////////////////////////////////////
MyLoadVars.onLoad = function(success) {
if (success) {
// create an empty array
var subMenu = new array();
subMenu0 = this.name0;//= "USA Instruments-wm"
subMenu1 = this.name1;//= "Developers Diversified Realty-wm"
subMenu2 = this.name2;//= "Sandridge Food Corporation-wm"
subMenu3 = this.name3;//= "StevensPainton Corporation-wm"
subMenu4 = this.name4;//= "Highland Schools-wm"
subMenu5 = this.name5;//= "Peninsula Associates Architects-wm"
subMenu6 = this.name6;//= "StructurePersonnel-wm"
subMenu7 = this.name7;//= "PsiBase-wm"
///////////////////////////////////////////////////////////////////////////////////////
//creates new array "subMenuClips"
subMenuClips = [];
for (var k = 0; k<subMenu.length; k++) {
if (this["subMenu"+k] != null) {
subMenu_array.push(this["subMenu"+k]);
}
//trace("subMenu "+subMenu_array.length);
var smb = _root.attachMovie("subMenuMC", "subMenu"+k, k);
subMenuClips.push(smb);
//postion movie clip on stage
smb._x = 300;
smb.tf.text = subMenu[k];
smb._y = 20+_root["subMenu"+k]._height*k;
smb.num = k;
//////////////////////////////////////////////////////////////////////////////////
}
}

Dynamic Menu
I'm currently working on my portfolio site._ I have the design done and I have a basic actionscripting experience._ My problems occurs when I ran into my side menu.

I would like to have a menu that scrolls up and down depend on how long the list inside the menu is._ Also the menu would also need to be able to have links that controls other clips on the stage (which I think I can do)._ The menu list would need to be able to be updated using an external file, such as html or text files._ I read some of your posts regarding this topic and followed your intructions, however I was unsuccessful._ Would it be possible for someone to help me figure this out? Or just provide a sample file? Thanks for anyone's help!

Copyright © 2005-08 www.BigResource.com, All rights reserved