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




Button For Expand/collapse An Xml Tree



Hello Every1,

I have a question as i am new to flash i need all the help i can get.

Basically what i need is to have a button named "openTree" which when cllicked expands the whole xml tree. I know i can start it of by putting:

openTree.onRelease = function () {

//code to open tree here

};

however i am not sure what the code is or what to look into. I need a similar one for when you want to close the tree with a close button named "closeTree".

Any help is greatly appreciated.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 03-25-2007, 12:48 AM


View Complete Forum Thread with Replies

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

+ - Expand/collapse
ok in bringing XMLtext in to Flash, you know how when you view XML in IE it is collapsable and expandable (like windows explorer etc)
is it possible to achieve this result in flash so it pushes the text below it down when it is expanded?
thanks
Dan

Collapse/Expand Menu
Hello, i searched long time but i found only menu creator softwares.
Do you know any tutorial about expand menus?

Expand / Collapse Navigation.
Ello -

I'm wanting to create an expand/collapse style navigation like the one found here: http://www.24-7media.de/

Using the tutorial found here: http://actionscript.org/tutorials/a...ted/index.shtml - I've gotten a bit of a start on it. But I'm not that familiar with functions in Flash so I'm a bit stuck. I've attached my .fla file. Any help you could give me would be greatly appreciated.

Expand / Collapse Navigation
Ello -

I'm wanting to create an expand/collapse style navigation like the one found here: http://www.24-7media.de/

Using the tutorial found here: http://actionscript.org/tutorials/a...ted/index.shtml - I've gotten a bit of a start on it. But I'm not that familiar with functions in Flash so I'm a bit stuck.

Below is the AS code I've got so far. It will open and close the menus - but I want menu 1 to close when menu 2 is opened. Also - I can email my .fla to someone if it would help them figure out where I'm going wrong.


ActionScript Code:
spacing = 5;
 
function tweenBox_01() {
    easeType = mx.transitions.easing.Strong.easeOut;
        var begin1 = 17;
        var end1 = 300;
        var time = 1;
        var mc = box_mc;
    if (!out1) {
        boxTween = new mx.transitions.Tween(mc, "_height", easeType, begin1, end1, time, true);
        out1 = true;
    }else{
        boxTween = new mx.transitions.Tween(mc, "_height", easeType, end1, begin1, time, true);
        out1 = false;
    }
}
 
function tweenBox_02() {
    easeType = mx.transitions.easing.Strong.easeOut;
        var begin2 = 17;
        var end2 = 300;
        var time = 1;
        var mc = box_mc2;
    if (!out2) {
        boxTween = new mx.transitions.Tween(mc, "_height", easeType, begin2, end2, time, true);
        out2 = true;
    }else{
        boxTween = new mx.transitions.Tween(mc, "_height", easeType, end2, begin2, time, true);
        out2 = false;
    }
}
 
box_mc.onPress = tweenBox_01;
box_mc2.onPress = tweenBox_02;
 
this.onEnterFrame = function(){
    box_mc2._y = box_mc._y + box_mc._height + spacing;
    box_mc3._y = box_mc2._y + box_mc2._height + spacing;
    box_mc4._y = box_mc3._y + box_mc3._height + spacing;
}

MovieClip Dynamic 'expand/collapse'
I'm using OnClipEvent to 'expand/collapse' a MovieClip by changing the _Xscale and _yscale properties. My problem is, I want to trigger it from a button. I've tried a couple of things, but I'm getting errors. I'm not sure if I should add the code to the button, or the MovieClip.

Problem In Expand-collapse A Movieclip
Hi,
There is one movieclip containing scrollpane.Here I attached a movieclip(mainMC) containing dynamic text
and a button.Then below this three other movieclips (same type say, submainMC)containing textfield are
attached.Now after clicking the button in mainMC the bellow movieclips should be expanded and collapsed.
I have written separate classes associated with each MClip.I attached all the MCs in same scrollpaneMC. Now to expand-collapse can you give me any reference to
proceed, as i am completely new to this area.Thanks.

Using OnClipEvent To Expand/collapse A Frame
I'm using OnClipEvent to 'expand/collapse' a MovieClip by changing the _Xscale and _yscale properties. My problem is, I want to trigger it from a button. I've tried a couple of things, but I'm getting errors. I'm not sure if I should add the code to the button, or the MovieClip.

As2.0 Expand/collapse Menu Help Needed
Hi,

I'm working on an expand/collapse menu in as2.0, so far the menu expands properly but when I click on the next heading it doesn't collapse the same way it expanded, which is the effect I am trying to achieve. How can I change the script so the menu expands/collapses in the same way, and is it possible to speed up the expansion/collapse? I have attached a zip of the fla and swf.

thanks for the help
Greg

Here is my as for each menu (header) button...

stop();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
this.onRelease = function(){
tellTarget ("/main")
gotoAndPlay(15);
}
stop();

Good Clean Expand/collapse Menu?
I'm using Flash MX 2004 and would like to creat a nice clean expand/collapse menu for a left hand navigation. Anyone know of a good tutorial of how I can set something up like this:

http://www.imagevuex.com/documentation/menu.html

Note: This was part of a frameset which is why the links all open a separate window. I ultimately would like to use this menu to load SWF's into the same flash file.

[CS3] Clean Expand/collapse Menu For Beginner.
Hey all
I am looking to create a text-only side menu for a portfolio site.
www.hingston.net is a good example, (like the fade animation too on the text).

Does anyone know of a tutorial or resources on how to make this? Only ones i can find are a bit confusing and more animated with graphics...

I need to be able to have sub-menus too, eg:

work > project 1 > image 1 / 2 / 3 / info

Really struggling on this, be great to get a little help

Array Menu With Subs Expand And Collapse.
Hi,

I managed to make a array menu very simpel. But i'm trying to figure out how i can add sub items to main items. And how to expand and collapse on action.

So basicilly i have 2 main items Lets say Intro and Outro.
When a user selects intro i want it to expand and view 2 new items (the subs), outro has then moves to the bottem making room for the subs (the animation works horizontal). And if Outro has been selected the already expanded subs collapse, outro moves back to his old position making room for his subs to expande beneath him.

Schematics:

Intro
Outro

Intro
----Hello
----Come Again
Outro

Intro
Outro
----Bye Bye
----Talk again

So all of this is working with Arrays and some actions.
I have been searching to the forums but i cant seem to find the light!!!

Anyone please suggestion, tips, links.

Great much thanks

Tree Component And Auto Expand ?
Ok,

I have at this for too long and now need help!

Using MX 2004 AS 2.0, I need to auto expand a Tree component to a node.

I can not get this to work. When I try to walk through the Tree's items I keep getting undefined XMLNodes.

Does someone have code that will expand all the branches of a Tree?

thanks,

sprout

Tree Component Expand All Nodes?
Is there anyway to expand all branches at once with the tree component?

Pls Help!

Quick Question: How Do I Set A Tree On Expand Mode When Opening Up A Movie?
Quick Question: How do I set a Tree on expand mode when opening up a movie?

Expand Button
Hi There!
Does anyone knows where i can find a tutorial to make buttons like these:

http://www.flashkit.com/movies/Inter...00/index.shtml

[F8] Expand Button Range
Hello
I have a series of buttons that load text from an external file. Right now it is set for 7 buttons. But I want to expand it to over 100 or so. How would I do that wit this script. I believe it has something to do with the last line ("(-1)-1]") but I don't really understand this script. Can some one show me how to expand it to a larger number of buttons pleas.

Thanks. Code follows


stop();

var my_array=new Array();
dtext.html = true;

var buttonText:LoadVars = new LoadVars();
buttonText.onLoad = function(success) {
if (!success) {
dtext.htmlText = "<b>FAILED TO LOAD</b>";
} else {
for(var i=1; i<7; i++) {
mc=eval("this.button"+i);
my_array.push(mc);
_root["mcbutton"+i].onRollOver = function(){
this.gotoAndPlay(2);
assignText(this);
}
_root["mcbutton"+i].onRollOut = function(){
this.gotoAndPlay(21);
dtext.htmlText = "";}
}
}
};
buttonText.load("buttonText.txt");

function assignText(who){
dtext.htmlText = my_array[who._name.substr(-1)-1];
}

Expand And Squeeze Button... But How ?
there are many sites with that kind of menu. When you rollover a button, it expands and squeeze the others and keeping the same space between the buttons. I am trying to create this effect, but I can't find a way. Here is the beginning of my script :


Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var buttonInit:Object = new Object();
var posX:Number = 50;
var posY:Number = 50;
var spaceBut:Number = 5;
var xScaleOver:Number = 120;
var xScaleOut:Number = 100;
buttonInit.onRelease = function() {
trace(this._name);
};
buttonInit.onRollOver = function() {
var locX:Number = this._x-((((this._width*xScaleOver)/100)-this._width)/2);
var xScaleTween:Tween = new Tween(this, "_xscale", Strong.easeOut, this._xscale, xScaleOver, 1, true);
var locXTween:Tween = new Tween(this, "_x", Strong.easeOut, this._x, locX, 1, true);
};
buttonInit.onRollOut = function() {
var xScaleTween:Tween = new Tween(this, "_xscale", Strong.easeOut, this._xscale, xScaleOut, 1, true);
var locXTween:Tween = new Tween(this, "_x", Strong.easeOut, this._x, this.posX, 1, true);
};
for (var i:Number = 1; i<4; i++) {
var newName:String = "but"+String(i);
var newDepth:Number = this.getNextHighestDepth();
var newButton:Object = this.attachMovie("button", newName, newDepth, buttonInit);
newButton._x = posX;
newButton._y = posY;
newButton.posX = posX;
posX += newButton._width+spaceBut;
}
here is a link : http://www.e-novative.ca/menu/test.html

Collapse Layers?
Is there anyway to collapse your layers of only the one you selected?

Cheers...

No Code Collapse? Why Not? :(
A long time ago when I heard that Dreamweaver 8 would be getting code collapse, I sort of assumed Flash 8 would be getting it as well. It seemed logical to me, but all I can find about it now is that people are complaining that it's only Dreamweaver, and that Flash won't have this awsome feature (Kind of like I am right now ).

I was wondering if anyone knows of a good external text program that has this feature? Thanks!

Unknown Collapse
I am doing a proyect that use several movie clips, each one with a rollOver event. When I move the mouse pointer really fast over many movieclips the movie collapse. Somebody knows how to fix the problem? I don't know what to do.

Collapse Menu
http://www.flashkit.com/movies/Inter...dex.php?chk=no


does anyone know where i can find a simliar menu that collapses sideways insted of down?

that i can customize

tanx

Expandable Banner Can't Collapse
I'm creating an expandable banner in flash. It expands automatically when the cursor is inside the banner area and collapse when the cursor is outside the banner area.

Here's the problem. The movie area is equalto the expanded size so after the banner expands, the whole stage is covered by the banner. When the user rool out of the banner area, he's no longer inside the flash movie area, therefore the actionscript doesn't work. That means once the banner is expanded, it stays that way.

I hope somebody can help me with this.

Thanks in advance

Collapse Flash Code When Done ?
I have seen flash ads on sites that play and once they are completed they cinch up or collapse and the HTML will rise up. Does anyone know how this is done? I want the advertisement to play above the HTML. Not float over the HTML, but actually push the HTML down the page, then when the ad is done, I want the Flash to collapse and the HTML to rise to the top. thanks.

Menu Collapse Issue
I was trying to create a drop down menu (like in a program but automated with mouseover) if Flash. I played around using one of the tutorials on this site to design the menu. The problem is the tutorial calls for a manual click. I had no problem setting the mouseover parameters. The problem is I have no idea how to code it to collapse. Any guidance would be appreciated.

Thanks!

Vertical Collapse Menu
I am interested in a minimalistic vertical collapse flash menu bar for my new website - just as found on www.Bjarnhof.com - to be integrated with a site produced in Dreamweaver CS3.
I am still a beginner - looking for advice on how to obtain the effect or info where to purchase the necessary code.
Will need at least 3 sub-levels. Preferently something that is search engine friendly
regards

Tree Component And Regular Button
Hi,

I am not sure if I am on the right forum but anyway, I was wondering if it is possible to use the tree component and a next button. Here is the scenario, I want to be able to use the tree component to load movies on to an empty clip, at the same time I will have a next and back buttons that when clicked will load the next movie under the hierarchy of the tree menu, with this the tree menu also changes such as the background of the link that is active also changes. Can the tree component be controlled externally with a button or thru the timeline.


Thanks.

Al

Tree Component And Regular Button
Hi,

I am not sure if I am on the right forum but anyway, I was wondering if it is possible to use the tree component and a next button. Here is the scenario, I want to be able to use the tree component to load movies on to an empty clip, at the same time I will have a next and back buttons that when clicked will load the next movie under the hierarchy of the tree menu, with this the tree menu also changes such as the background of the link that is active also changes. Can the tree component be controlled externally with a button or thru the timeline.

Thanks.

Al

Button Area On The Tree Menu
hi!!

is it possible to make the button area all the line instead of only the small arrow?

thnx in advance
Guilherme

Accordion/Tree Navigation ... Tree DataProvider Issues
Hello all!

I've done a navigation scheme that uses both the accordion and tree components. The data being gathered is from an XML file. The only problem i'm having is getting the tree components to display the data that they're being provided with. I did traces and I found out that they are getting the data...can anyone take a look at the FLA and see what's going wrong?

http://www.jake3p0.com/downloads/accordionTreeNav.zip

I'm using Flash 8

Collapsible Menu That Will Hopefully Open And Collapse.
I am currently building a collapsible meu which I hope I can get to collapse. My code is below and it currently does everything great with loading the XML into objects, I get the parameters sent to each button I am creating on the fly. But my problem where I stand atm is that the subbuttons attach to the MainButtons ok, but I want to be able to hide them (well actually I would like the whole menu to animate a drop when a user mouses over a MainButton that has subs)until the button is pressed or rolled over or only attach when the user mouses over the MainButton, and then have the Main buttons below the one I am activating to drop away to make space for the subButton.

It has been a struggle to get it to here for me but I am happy with the code I have so far. Would just like some goint pointers or sample code to try and understand for where to go from here. I have been working on this for a while and am beginning to understand AS a little better but still need a BIG hand with what I go to go. I hope to componentise this when I get it finished for both myself and anybody else wanting it.


Code:
var MenuArea = "Home";
var ContentFrame = "Content";
getXML("soo.xml");
menuItems = [];
// Load XML
function getXML(section) {
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = getXMLLoadHandler;
menu_xml.load(section);
}
//
function getXMLLoadHandler(success) {
if (success) {
trace(this.firstChild.nodeName+" loaded.");
var mainButton = this.childNodes[0].childNodes;
//trace("Main Button is: "+mainButton);
var mainButtonLength = mainButton.length;
//trace("Main Button Length is: "+mainButtonLength);
for (var i = 0; i<mainButtonLength; i++) {
var activeList = mainButton[i].childNodes;
//trace("Active List is: "+activeList);
var activeListLength = activeList.length;
//trace("Active List Length is: "+activeListLength);
var mainButtonObj = {};
mainButtonObj.name = mainButton[i].attributes.name;
if (mainButton[i].attributes.href != undefined) {
mainButtonObj.href = mainButton[i].attributes.href;
mainButtonObj.subs = 0;
} else {
mainButtonObj.subs = activeListLength;
}
mainButtonObj.subbutton = [];
for (var j = 0; j<activeListLength; j++) {
var subButtonObj = {};
subButtonObj.name = activeList[j].attributes.name;
subButtonObj.href = activeList[j].attributes.href;
mainButtonObj.subButton.push(subButtonObj);
}
//---add complete item to master array
menuItems.push(mainButtonObj);
}
delete my_XML;
doString();
trace("<<===================== Setting up the Buttons with Variables =====================>>");
AttachButtons();
} else {
trace("---Menu content failed to load");
}
}
//
function doString(mainButton, mainButtonLength) {
var mainButton = menu_xml.childNodes[0].childNodes;
var theString = "My "+menu_xml.childNodes[0].nodeName+" has "+mainButton.length+" "+menu_xml.childNodes[0].firstChild.nodeName+"s
______________"+"
";
for (var s = 0; s<mainButton.length; s++) {
theString += "#"+s+" "+menu_xml.childNodes.firstChild.nodeName+" ===="+"
"+"Main Button Name: "+mainButton[s].attributes.name+" - Main Button URL: "+mainButton[s].attributes.href+"
";
for (var t = 0; t<mainButton[s].childNodes.length; t++) {
theString += " >>> Sub Button "+t+" Name: "+mainButton[s].childNodes[t].attributes.name+" - Sub Button "+t+" URL: "+mainButton[s].childNodes[t].attributes.href+"
";
}
}
trace(theString);
}
function AttachButtons() {
//the number of buttons to be created calculated from Arrays
var ButtonNumber = menuItems.length;
//the loop to make the Buttons
for (var i = 0; i<Number(ButtonNumber); i++) {
//Setting up variable to pass to each button in the new object ButtonVars
var SlideStart = 0;
var SlideSpeed = 50;
ButtonVars = new Object();
ButtonVars.ButtonName = menuItems[i]["name"];
ButtonVars.ContentURL = menuItems[i]["href"];
ButtonVars.ContentFrame = ContentFrame;
//Attach the Main Button MC to the timeline and pass the ButtonVars variables
this.attachMovie("ButtonNoOutline_mc", "MainButton"+i, i, ButtonVars);
var SlideEnd = _root["MainButton"+i]._height*i;
_root.MainButton[i].ButtonHome = SlideEnd;
_root["MainButton"+i]._x = 1;
_root["MainButton"+i]._y = _root["MainButton"+i]._height*i;
trace("#"+i+" =====");
trace("Main Button Name: "+ButtonVars.ButtonName+" - Main Button URL: "+ButtonVars.ContentURL+" - Slide Start: "+SlideStart+" Slide End: "+SlideEnd+" Slide Speed: "+SlideSpeed);
//
AttachSubButtons(i);
}
}
function OpenMenu() {
}
//
function AttachSubButtons(i) {
//the number of Sub Buttons to be created calculated from Arrays
var SubButtonNumber = menuItems[i]["subs"];
//the loop to make the Sub Buttons
for (var s = 0; s<Number(SubButtonNumber); s++) {
//Setting up variable to pass to each button in the new object SubButtonVars
var SlideStart = 0;
var SlideSpeed = 50;
SubButtonVars = new Object();
SubButtonVars.ButtonName = menuItems[i]["subButton"][s]["name"];
SubButtonVars.ContentURL = menuItems[i]["subButton"][s]["href"];
SubButtonVars.ContentFrame = ContentFrame;
//Attach the Sub Button MC to the timeline and pass the SubButtonVars variables
this["MainButton"+i].attachMovie("SubButton_mc", "SubButton"+s, s, SubButtonVars);
var SlideEnd = this["MainButton"+i]["SubButton"+s]._height*s;
this.MainButton[i].SubButton[s].SubButtonHome = SlideEnd;
_root["MainButton"+i]["SubButton"+s]._x = 2;
this["MainButton"+i]["SubButton"+s]._y = this["MainButton"+i]["SubButton"+s]._height*s + 15//_parent._height;
trace(" >>> "+menuItems[i]["name"]+" Sub Button "+s+" Name is: "+menuItems[i]["subButton"][s]["name"]+" - URL is: "+menuItems[i]["subButton"][s]["href"]+" - Slide Start: "+SlideStart+" Slide End: "+SlideEnd+" Slide Speed: "+SlideSpeed);
}
}

How Am I Gonna Add Sub Menus To That Collapse Menu
i couldnt find a way to add sub menus.How am i supposed to add?

How Am I Gonna Add Sub Menus To That Collapse Menu
i couldnt find a way to add sub menus.How am i supposed to add?

[F8] Adding Next Node Button To Tree Menu
Hello. I'm building an application based on the Tree component that is populated from an XML file. I followed the example given in the flash help files with a few additions and the basic functionality is working. I'd now like to add a button that is able to skip to the next node in the tree (basically the same as would happen if you click on a node and then press the down cursor key).

Is anyone able to give me an idea of how I'd go about this, either by doing it properly with additions the the actionscript file or just by replicating a keystroke when the button is clicked?

This is my code held in an external actionscript file:


Code:
import mx.controls.Tree;

class TreeNavMenu extends MovieClip {
var menuXML:XML;
var menuTree:Tree;
function TreeNavMenu() {
// Set up the appearance of the tree and event handlers.
menuTree.setStyle("fontFamily", "_sans");
menuTree.setStyle("fontSize", 12);
// Load the menu XML.
var treeNavMenu = this;
menuXML = new XML();
menuXML.ignoreWhite = true;
menuXML.load("TreeNavMenu.xml");
menuXML.onLoad = function() {
treeNavMenu.onMenuLoaded();
};
}
function change(event:Object) {
if (menuTree == event.target) {
var node = menuTree.selectedItem;
// If this is a branch, expand/collapse it.
if (menuTree.getIsBranch(node)) {
menuTree.setIsOpen(node, !menuTree.getIsOpen(node), true);
}
// Get variables from XML
var Title:String = node.attributes.label;
var Desc:String = node.attributes.desc;
var url:String = node.attributes.url;
var jpegURL:String = node.attributes.jpegURL;
var prodURL:String = node.attributes.prodURL;
var pdfURL:String = node.attributes.pdfURL;
var category:String = node.attributes.category;
trace(Desc);
trace(url);
trace(jpegURL);
trace(prodURL);
trace(pdfURL);
_parent.Title.text = Title;
_parent.Desc.text = Desc;
_parent.prodURL.text = prodURL;
_parent.jpegURL.text = jpegURL;
_parent.pdfURL.text = pdfURL; }
}
function onMenuLoaded() {
menuTree.dataProvider = menuXML.firstChild;
menuTree.addEventListener("change", this);
}
}


Any help would be appreciated, Peter.

Collapse Flash Code When Done Playing Movie?
I have seen flash ads on sites that play and once they are completed they cinch up or collapse and the HTML will rise up. Does anyone know how this is done? I want the advertisement to play above the HTML. Not float over the HTML, but actually push the HTML down the page, then when the ad is done, I want the Flash to collapse and the HTML to rise to the top. thanks.

[F8] File Included: How Do I Collapse My Expanding Menu?
goto http://homepage.mac.com/amanda.perry/FileSharing17.html and download file "rolloutmenu.fla"

I have a current drop down menu I have made for a website. Currently I have it so that when you click on a button it will expand the submenu and then when you roll out of the area of that menu it will collapse so that you can only have one menu open at a time.

What I really want it to do is. I want you to be able to click on a button, like for example "FAQ" and I want the submenu to stay open no matter where your mouse is so that you can be in the FAQ section and the menu is still open. which is easy, I would just eliminate the invisible rollover button. But the part I can't figure out is that when you click on any other heading button, I want whatever expanding menu is currently open to automatically close, so that there is no more then one menu expanded at a time.

I was thinking that I might be able to use an if else statment with an assigned variable... but I don't know how to use those well enough.

Any help is greatly appreciated.
Amanda

How Do I Make A Tree Menu? Like The Explorer Tree?
I am currently writing a tree menu in flash that will look nearly identically to the std tree widget in windows (like explorer).

my problem is.. how do i link an object to an mc?

ie i have made a node class with member variables and methods (an array of child nodes and the LoadChildren method) and i have an mc that i want to be duplicated for each node (a little folder icon thingy).

when a node loads its children via xml it will get the data then create an array of child node objects:

for each child in xml
{
var node = new node("name from xml", "data from xml");

children.push(node);
}

so at the end of this i have a nice array of child nodes.

I dont know if i put the code that defines the node class into the folder thingy mc and then duplicate that or what..

Has anyone seen an example of something like this anywhere.. i saw a cool tree ages ago but i cant find it now..

I know its a bad explanation but my brain hurts at the moment

thanks for any help =]

Collapsing XML Menu No Idea Where To Begin Changing The Coding To Make It Collapse
Hey guys... sorry for posting again but I'm stuck...

I need to make an xml generated menu that when the user clicks on an option, the menu closes down to show only the clicked item, then it opens a new submenu... unfortunatly my knowledge of AC is VERY limited

here's the code I'm using so far


Code:

// ActionScript Document


GenerateMenu = function(container, name, x, y, depth, node_xml) {
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
for (var i=0; i<node_xml.childNodes.length; i++) {
curr_item = curr_menu.attachMovie("menuitem","item"+i+"_mc", i);
curr_node = node_xml.childNodes[i];
if(curr_node.attributes.rank == "main"){
y = 50;
}

curr_item._x = x;
curr_item._y = y + i*curr_item._height;
curr_item.trackAsMenu = true;
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;
curr_item._alpha = 0;

if(curr_item._alpha < 100){
curr_item._alpha += 15;
}else{
if(curr_item._alpha == 100){curr_item._alpha = 100;}
}
if (node_xml.childNodes[i].nodeName == "menu"){
curr_item.node_xml = curr_node;
curr_item.onRelease = function(){
var x = this._x + this._width + 5;
var y = this._y;


GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml);

};
}else{
curr_item.arrow._visible = false;
curr_item.onRelease = curr_item.onDragOver = function(){
Actions[this.action](this.variables);
};
}

curr_item.onRollOut = curr_item.onDragOut = function(){
var col = new Color(this.background);
col.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
};
}
};

Createmainmenu = function(x, y, depth, menu_xml){
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild);
mainmenu_mc.onMouseUp = function(){
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseSubmenus();
}
};
};

CloseMainmenu = function(){

mainmenu_mc.removeMovieClip();

}

CloseSubmenus = function(){
mainmenu_mc.submenu_mc.removeMovieClip();
};

Actions = Object();
Actions.change = function(imgSrc){
slideShow.animator.slide.loadMovie(imgsrc);
};
Actions.message = function(msg){
message_txt.text = msg;
};
Actions.newMenu = function(menuxml){
menu_xml.load(menuxml);
};

menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok){
if (ok){
Createmainmenu(10, 10, 0, this);
message_txt.text = "message area";
}else{
message_txt.text = "error: XML not successfully loaded";
}
};
menu_xml.load("menu1.xml");



I've searched Google, Yahoo, MSN, everywhere... but nothing even remotely like this has come up... so please guys... any chance of a hand with this

Thanks
PJ

Need To Find Tree Graph Or AVL Tree
Does anyone know where I can find a tree graph, also called an avl graph, which I can modify? I am creating a flash console to manage computer nodes on our system and need a dynamic tree graph to represent where the nodes are located and be able to represent child/parent relationships. It would greatly help if I found an example or something to build off of.

Thanks!

Expend All Folders In Tree (tree Component (Flash MX 2004/Flash 8))
Hello all,

I have a tree component witch reads an XML file. Now On my tree I got folders and subfolder. I want by a press of a button, to be able to expend all the folders of my tree. How do you do this?

Tree format: (view attachment)

Tree XML file:

PHP Code:



 <node label="Project 1">
     <node data="data1" label="Item1" />
     <node data="data2" label="Item2" />
     <node data="folder1" label="Folder">
              <node data="data3" label="Item 1 in folder" />
              <node data="data4" label="Item 2 in folder" />
              <node data="folder2" label="Folder in folder">
                       <node data="data5" label="Hello!" />
              </node>
     </node>
</node>





Any ideas, paths? Please!

Thank you A LOT in advance!

How To Expand A Swf?
I have a liquid layout with external swfs loading into holders. however the holders are a dynamic size depending on the size of the stage. this means that depending on if the user is in a 4:3 display or a 16:9, it may get skewed (16:9) display. I was wondering if there was a way to tell flash to expand the background color of the eternally loaded swf, but keep the content placed in the center?





























Edited: 06/07/2008 at 10:51:58 AM by mlebrun

Expand Box With AS
Hi Everyone,

I'm trying to create and expand a simple empty box (hairline perhaps) with an Action script to create the same effect as a shape tween. Why not shape tween?! Well I've tried that and the shape tween messes up the rendering. see picture....

I appreciate your thouthts,

thx,

mucho

Expand Box With AS
Hi Everyone,

I'm trying to create and expand a simple empty box (hairline perhaps) with an Action script to create the same effect as a shape tween. Why not shape tween?! Well I've tried that and the shape tween messes up the rendering. see picture....

I appreciate your thouthts,

thx,

mucho

*.swf - To Expand With Browser
Hi
I wish to make include a *.swf on a web page and I want it to expand and contract to fit the browser. Ie if the user minimises the window the .swf with shrink down and if the user maximised the movie expands accordingly. I wish to center the movie in the middle of the page. Any ideas?
Thanking you
Miffy

How To Expand Movie In Web?
Hi

I'd like to know how to expand the swf (in web document), when the browser window is resized. Like in this site. (I guess its javascript who do that !?)

http://md.lv

Thank you.

Expand Banner....
Hi,

Expand banners in Flash...flash banners are now days or dynamic when you mouse over they will expand(dropdown)with more description or details about the advert and when you mouseout they will be standard size banners.

Similar kind of banner i have to do so anyone can help

Expand Submenu
Hi...

Somebody knows how can i make a menu that when i put the cursor over the buttom (an item) expands othe itens (submenus)

Thanx

Expand & Contract
I have 8 navigation buttons arranged horizontally.

The up state for all the buttons is the same. It's 2 arrows... like this >>

The over state for each button is different.

Thoughts on scripting the buttons to move to the left and right of when one of the buttons is 'moused-over'??

I've had limited success....since the 'hit' area is only the size of the arrows and the link text is larger than this area....


Thoughts? Examples?

Thanks a ton,
Blue

Expand Contract
Imagine you have a grid of movieClips on the stage. When mousing over any one of the mcs, that mc will expand it's x&y scales to be a bit bigger. The effect i am looking for is getting the other mc's to pull away or make room around that expanding mc, and then to contract back to their original positions. I have the retraction to original positions down (simply assigned original x&Y to each mc class, and a bit of ease on the way back in), but the expansion is random at best. At present, i have mcs moving everywhere and i can not seem to nail down the trig on this. Can anyone give a good direction to go with this method? Is there a common name for this effect which i can google?

Expand / Drag
Hi All,
I'm having trouble getting a response in the Flash MX forum... my post can be seen at

http://www.actionscript.org/forums/s...d.php3?t=72499

Sorry - this is probably illegal, but I would desperately like a response please!
Thanks all.

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