Expand/contract
Ive got a menu that expands when you click it once, but I don't know how to make it contract when you click it the 2nd time. Plz help
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 01-18-2007, 02:50 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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/Contract MC's (Menu's)
Dear Forum Genuises,
As an intermediate project I was looking for how to recreate this presentation
http://www.royalcaribbean.com/multim...ipClassCode=VY
It's the ship, then you can expand the different areas of it, then click to open an information window where you can view tours or photos. I am trying to achieve the basic framework to customize... Please Advise!
Thank you Greatly in Advance.
Andrew
Webmaster Contract.....please Help
I've been asked by a local company here to be their permanet webmaster, and to provide them with a contract for such a job. I've been writing a few things but I'd like to know if there's anything that you have experienced in the past that should be included in a contract to save one's a$$. I'm clueless as to what a contract should or shouldn't have, so any help would be greatly appreciated.
thanks a lot
Contract Websites
I am a freelancer and always looking for work.
I posted the URLS in a couple other forums.
http://www.sideliners.ca
http://www.freelancedeveloper.org
YO
Help With Contract Work
Hi all,
I've finished my website http://www.isokodesign.com
I'm looking for contract work, so please if you know of anyone wanting something done in flash, let them know my rates start at $200. Thanks and Merry Christmas.
Help First Contract In Danger Due To Plugin Issue
Hi,
Big problem came up. I'm starting an online education company and produced my first course using Flash MX. I had a company call me last week wanting to purchase the course. One person viewed the course fine, but two others couldn't view it. I thought I had this problem fixed, and had tested it out on different systems with no problem. But apparently not. I have to talk with them on Monday to work it out. If I don't, then no contract!
The course has video embedded. I originally had problems until plugin 6.0.29 came out, and after that, things seemed to work fine.
I thought it might be a firewall issue, but the guy who could view it is in the same building and thus probably behind the same firewall. They were both using Win2K, and I know the one who couldn't view the course was using IE5.5. They loaded the plugin from the Macromedia site, and rebooted their computer. Still didn't work.
Can people give me some input so when I talk to them on Monday I might be able to try some different things? The course is at:
http://design4X.com/courses.html Choose the free preview for "Customer Focused Design Using QFD" (I use javascript launchwin to open the swf)
Direct access is at:
http://design4x.com/courses/qfd/high/qfd-preview.html
Thanks! I will be eternally grateful.
Need Flash Developers For A Short Contract
Hi there,
We are looking for some flash developers to help with some flash work for a customers site. We are looking for about 2 people who must be at an advanced level and have a decent portfolio.
For more information on what is needed etc then please get in touch with me.
bren@indigoonline.com
Contract Job - Seeking Flash Animation
To the administration/moderators of this forum:
Please excuse me if this post was not posted in the correct forum and if not please move it accordingly.
- Thank you
Animator
Currently seeking an animator to complete a flash movie for an introduction scene to a video game. Depending on the quality of the introduction scene and the good standing’s of the animator there will possibly be the need for further cut-scene animations.
Requirements
- Eighteen years of age living in the United States
- Able to meet deadlines.
- Able to draw out a storyboard and present it.
- Past experience
Please send resume or links to past work at dave@coderdave.com
Sincerely,
Dave Neubelt
Contract Flash Developers - Where Do They Hang Out?
First, my apologies to the forum Moderators if this is a violation of forum rules. I am not attempting to post a help wanted ad, but rather inquire where the best places are to do so.
We are a Minneapolis-based communications and design firm and we are in need qualified Flash developers. We are looking mainly for independent contractors, but we don't rule out hiring should we meet the right person. The Flash contractors would have to be in the Minneapolis / St. Paul area because the nature of our projects requires close teamwork and our experience has been that exclusively virtual teams don't work well for our business.
We have found Monster.com and the other big boards are not a great fit for advertising for contract developers. So where do all the Flash contractors hang out? Could someone please point me to some of the more-likely places to post for quality resources?
Thank you.
ECommerce Contracts. Commission Contract.
Okay, does anyone have a contract for something like this or ever done a contract for something like this?
I'm building an eCommerce Site for a business and they are offering me 10% of all sales completed through the site for as long as they use the site. I teach them how to add and remove items and such. Once I am done, I do not have to update anything, unless they want a revision with an extra charge. You guys have any ideas or references or resources that could help me out???
ECommerce Contracts. Commission Contract.
Okay, does anyone have a contract for something like this or ever done a contract for something like this?
I'm building an eCommerce Site for a business and they are offering me 10% of all sales completed through the site for as long as they use the site. I teach them how to add and remove items and such. Once I am done, I do not have to update anything, unless they want a revision with an extra charge. You guys have any ideas or references or resources that could help me out???
Need Expert Flash Programmer For Contract Work
I'm forwarding this for someone who is looking for a freelance expert Flash programmer. Requires advanced knowledge of flash with integration of server side coding. Development might include Flash with xml,asp and databases.
Please contact:
Cuono Inter@ctive
sales@cuono.com
Rates For Flash Development / Work Contract Also
Was wondering what the hourly rate was for a flash development site with an intermidate-difficulty site.
Does any have a contract that has helped them in locking down pay rates, timeline, scope of work?
Much Appreciated!
Andrea
Flash Animators Needed For Contract Based Work
Hello,
My name is Rich and currently work full time at a financial institution that i'll go without naming. I also have a IT solutions firm that has been in business for over a year. www.paradoxsolutions.com
Things are really starting to pick up for us and i want to take our site to the next level. I designed this site over a year ago and merely services as a presence on the web. Seeing that my time is limited I cannot re-design the site from scratch nor can i put forth the effort to learn flash extensively. I recently purchased a template that will save me time...now i want to modify the template and make it mine. Really the template is a 2advanced studios rip-off--looks remarkably similar to www.foundstone.com. Anyways, i have contacts in france and germany that do flash work for me from time to time and are dirt cheap. They will be unavailble due to extended projects they both have and i must now look for some good flashers that can help me in my projects. The first of which is re-designing www.paradoxsolutions.com. If anyone is interested in making some money on the side for some flash animation work please contact me ASAP, so i can give you more details. Ideally i want to work with someone who is friendly and willing to work things out. Arrogant designers need not apply. Please contact me at vinhaisr@paradoxsolutions.com for further details. Thanks for your time.
P.S.
I'm quite anxious on getting this underway, so please contact me ASAP to work out details.
PixelMover Class - Explode & Contract Pixels And Stuff
Hello, not sure if anyone has done stuff like this before, so thought I would post it and see what people think.
Try it:
http://flash.sitdap.com/pixelmover
Download source:
pixelmover_src.zip
...you create an instance of pixelmover, and give it a sprite with any graphics in.
methods:
spreadPixels(maxRadius:int) - maxRadius default value is 200
- will randomly splay the pixels of your given sprite about the place, staying within the maximum radius
movePixels(speed:int) - speed default is 6, lower is faster.
- at the moment, all this does is move back the pixels to their original position, then when they arrive it fades back to the original bitmap and removes itself from its parent. When it is all done, it dispatches an event called "PIXELS_MOVED".
so this is how I would use it:
Code:
var myPixelMover:PixelMover = new PixelMover(mySprite);
myPixelMover.spreadPixels(100);
addChild();
myPixelMover.addEventListener("PIXELS_MOVED", moveHandler);
myPixelMover.movePixels(4);
function moveHandler(evt:Event) {trace("the pixels are back where they were")
}
..It should adapt to any size you make your sprite, but I fear about performance issues with so many pixels and all.
Comments are welcomed - bad or good as I don't know whether everything is fully efficient as it could be. Feel free to add to it if you think it needs something!
cheers,
TD
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
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
*.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/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
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.
Drag To Expand
I want to make a selection box that will expand when dragging(like the selection marquee in windows explorer)
but I can´t seem to find any tutorials or sources relating to it...
I don´t know what to begin with, how can I make it?
Cannot Expand Movieclip Any More
I have a movie that I inherited that I think was made with Flash 5. I am working on a movie clip in it that scrolls almost 40 thumbnail images (now) horizontally using < > buttons. That's all good. I was adding thumbnails one by one and the movie clip area would expand to include them each time, until now. I have about 3 more to add and the movie clip won't expand any more. I can expand how far the 'scroll' will go to well beyond where the thumbnails end, but I can't physically add them any more. The properties box for the movie clip won't allow me to make the width larger either, but I think it would just stretch the symbol anyway, distorting it.
I had posted this problem in an other area yesterday and someone wanted to see the .fla file. I didn't know how to attach that. All I see is the Attach Code button below and that doesn't sound appropriate. So if someone wants to see it, please let me know how to do that.
Thanks,
Sue
ComboBox Expand Up?
I was wondering if there's a way to have a ComboBox component expand upward rather than downward. Many thanks for any input.
Expand Menu
Anyone know how to make navigation bar like
www.seraph.nl (its the site of the week)
Or link to the tutorial anywhere on the net.. i've searched and i couldnt find one..
Expand Shape?
Hey guys, I had a technique question, I have a graphic of a long rounded rectangle, and its a photoshop-produced graphic so its fancy and nonvector and all that.
I also have a squareish version of it (still rounded corners, but L and W are same, as opposed to being a rectangle) and I'd like to know how to expand the squarish one to form the original rectangle graphic
Let me know on your techniques =D
Possible To Expand The Height Of An Swf On The Fly?
Hi
Is there any function that allows to do this? Say I have an swf that is 400 pixels high and i add some content into it that is say 600 high, can I expand the whole swf's height to fit this new content or is using a scrollpane or something the only way this can be done?
Phil
XML Menu Expand Up
I need to get this to expand UP.
PHP Code:
/* LOAD XML NAVIGATION */////////////////////////////////////////////////////////// ************ Configuration *********************** //// general // main buttonsvar mainX = -759.3;var mainY = 10;var mainBtnSpacing:Number = 1;var mainBg:Number = 0xEBEAEA;var mainText:Number = 0xD5D5D5;var mainActiveText:Number = 0x499FD8;// sub buttons var slideInSpeed:Number = 0.5;var slideOutSpeed:Number = 0.5;var subMenuX:Number = 161;var subBg:Number = 0x000000;var subActiveBg:Number = 0x1A1A1A;var subBtnSpacing:Number = 34;// ************ End of Configuration *************** //////////////////////////////////////////////////////////// import needed classes import mx.transitions.Tween;import mx.transitions.easing.*;// set scope to this to avoid path issues var scope:MovieClip = this;scope.createEmptyMovieClip("mainMenu",2);// postion menumainMenu._x = mainX;mainMenu._y = mainY;// set the mask to hide menu when it goes past top level buttons//var mask:MovieClip = mainMenu.attachMovie("mask", "mask", 100);mask._width = 50; //Stage.width;mask._height = 50; //Stage.height;mask._y = Stage.height-50;//mask._alpha = 0;//mainMenu.setMask(mask);// used in createSubMenu function to choose which sub menu to closevar switcher:Boolean = true;// Load XMLvar menuXml:XML = new XML();menuXml.ignoreWhite = true;menuXml.onLoad = buildMenu;menuXml.load("content/xml/menu.xml");//menuXml.load("http://192.168.134.90/JoomlaEcom/read/index.php?action=top_level_cats");// Build Menufunction buildMenu(success:Boolean):Void { if (success) { button = this.firstChild.childNodes; var i:Number; for (i=0; i<button.length; i++) { var mainBtn:MovieClip = mainMenu.attachMovie("mainBtn", "mainBtn"+i, i+500); mainBtn.btnName.text = button[i].attributes.NAME; mainBtn.link = button[i].attributes.LINK; mainBtn.subMenu = button[i].childNodes.length; // positon top menu buttons mainBtn._x += mainMenu["mainBtn"+(i-1)]._x+mainMenu["mainBtn"+(i-1)]._width+mainBtnSpacing; // hide overMc mainBtn.overMc._alpha = 0; // if menu has sub menus if (mainBtn.subMenu) { mainBtn.subbutton = button[i].childNodes; mainBtn.createSubMenu = function():Void { // choose which menu to close var subMenu:MovieClip = mainMenu.createEmptyMovieClip("subMenu", i); // set current sub menu currSub = subMenu; var j:Number; for (j=0; j<this.subMenu; j++) { // create subBtns var subBtn:MovieClip = subMenu.attachMovie("subBtn", "subBtn"+j, j+9000); // slide in sub menu slide(subBtn,currSub._y,subBtn._height-subBtnSpacing*(j),slideInSpeed+j*0.4,"_y",Elastic.easeOut); //slide(subBtn,0,subBtn._height+subBtnSpacing*(j),slideInSpeed+j*0.4,"_y",Elastic.easeOut); subBtn.btnName.text = this.subbutton[j].attributes.NAME; subBtn.link = this.subbutton[j].attributes.LINK; // set sub bg color var subBgColor = new Color(subBtn.bg); subBgColor.setRGB(subBg); // position subBtns subBtn._x = activeMain._x; // sub button events subBtn.onRelease = function():Void { /* Links are set in the xml (the FILE LINK attribute) and are accessible by using "this.link" so you might want to do something like: scope.createEmptyMovieClip("placeholder", 2000); loadMovie(this.link, placeholder); if you want to open a http:// link try: getURL(this.link, "_blank"); */ trace(this.link); }; subBtn.onRollOver = function():Void { var subActiveColor = new Color(this.bg); subActiveColor.setRGB(subActiveBg); }; subBtn.onRollOut = function() { var subNormalColor = new Color(this.bg); subNormalColor.setRGB(subBg); }; } /* hit zone is used to create an area that if rolled over closes the menu. we use the mask mc again to save file size */ var hitZone:MovieClip = scope.attachMovie("mask", "hitZone", 1); hitZone._x = mainX+currButton._x-50; hitZone._y = currButton._y-999; hitZone._width = subMenu._width+100; hitZone._height = subMenu._height+subBtnSpacing+mainY+1000; // comment this line out if you want to see where it is positoned hitZone._alpha = 0; hitZone.useHandCursor = false; hitZone.onRollOver = function() { slider.stop(); closeMenu(); }; }; mainBtn.onRollOver = function():Void { slider.stop(); currButton.overMc._alpha = 0; this.overMc._alpha = 100; if (activeMain != this) { activeMain = this; activeStates(this.btnName); // build subs currButton = this; this.createSubMenu(); stopQuick(hitZone); } }; // events for buttons without subMenus } else { mainBtn.onRollOver = function():Void { currButton.overMc._alpha = 0; this.overMc._alpha = 100; if (activeMain != this) { activeMain = this; activeStates(this.btnName); closeMenu(); currButton = this; } }; mainBtn.onRollOut = function():Void { this.overMc._alpha = 0; activeStates(null,null); activeMain = null; currButton = null; }; mainBtn.onRelease = function():Void { if (activeMain != this) { /* Links are set in the xml (the button LINK attribute) and are accessible by using "this.link" so you might want to do something like: scope.createEmptyMovieClip("placeholder", 2000); loadMovie(this.link, placeholder); if you want to open a http:// link try: getURL(this.link, "_blank"); */ trace(this.link); } }; } } } else { trace("XML Failed to Load"); }}// timer to keep sub openfunction stopQuick(button) { time = getTimer(); scope.onEnterFrame = function() { time2 = getTimer(); if (Number(time2-time)>2000) { button.enabled = true; delete scope.onEnterFrame; } else { button.enabled = false; } };}// close menufunction closeMenu():Void { currButton.overMc._alpha = 0; slide(currSub,currSub._y,-currSub._height,slideOutSpeed,"_y",Strong.easeOut); //slide(currSub,currSub._y,currSub._height,slideOutSpeed,"_y",Elastic.easeOut); activeStates(null,null); activeMain = null; currButton = null;}// set/remove active statesfunction activeStates(txt):Void { // set active state txt.textColor = mainActiveText; // remove active state from former currButton.btnName.textColor = mainText;}// slide tweenfunction slide(who:MovieClip, startvalue:Number, endvalue:Number, y_speed:Number, prop:String, ease) { slider = new Tween(who, prop, ease, startvalue, endvalue, y_speed, true);}// ------------------------------------------------------- //
Code:
<?xml version="1.0" encoding="UTF-8"?>
<MENU>
<BUTTON NAME="About Us">
<SUB NAME="Submenu Link 1" LINK="sub1.swf" />
<SUB NAME="Submenu Link 2" LINK="sub2.swf" />
<SUB NAME="Submenu Link 3" LINK="sub3.swf" />
<SUB NAME="Submenu Link 4" LINK="sub4.swf" />
</BUTTON>
<BUTTON NAME="News" LINK="news.swf">
<SUB NAME="Submenu Link 1" LINK="sub1.swf" />
<SUB NAME="Submenu Link 2" LINK="sub2.swf" />
<SUB NAME="Submenu Link 3" LINK="sub3.swf" />
</BUTTON>
<BUTTON NAME="Services">
<SUB NAME="Submenu Link 1" LINK="sub1.swf" />
<SUB NAME="Submenu Link 2" LINK="sub2.swf" />
<SUB NAME="Submenu Link 3" LINK="sub3.swf" />
<SUB NAME="Submenu Link 4" LINK="sub4.swf" />
<SUB NAME="Submenu Link 5" LINK="sub5.swf" />
</BUTTON>
<BUTTON NAME="Contact" LINK="contact.swf"/>
</MENU>
ComboBox Expand Up?
I was wondering if there's a way to have a ComboBox component expand upward rather than downward. Many thanks for any input.
Expand Menu
Anyone know how to make navigation bar like
www.seraph.nl (its the site of the week)
Or link to the tutorial anywhere on the net.. i've searched and i couldnt find one..
Expand Out Of Bounds
Given a flash file with dimensions, like 300x400 embedded on an xhtml page, is there a way to allow the content to spill out of the box and over other elements? Ive seen this done on ads, but I want to use it for a navigation. Does anyone know how they do it?
Flash Expand Banner
Hi all, How to expand banner in browser, using flash banner..anyone can help
Graphic Expand On Rollover
Has any one seen the http://www.airforce.com web page.
If so you will see some very fast and very smooth expanding interface graphics.
I have a client that has requested this type of interface.
So far I have been able to actionscript a prototype that totally works using flash MX (exported as flash 4)...
But it runs slower and slightly more jerky than the air force site. I have tried cranking up the frame rate and using more frames, and also using less frames to no avail.
FYI: I am the serious artist/profectionist type. The difference in playback speed is small (My client probly wouldn't care)
but it annoys me.
If anyone has ideas for a Flash/Actionscript development direction for me that would be great.
Don
Image Shrink & Expand
Hello all. I'm a little unsure what is causing my image to 'shrink' & 'expand' when I have not transformed the image in any way.
Here is what I did: I stared with an image, converted it into a symbol. Then I changed the alpha 0% to 100% and back....all with the motion tween.
http://216.197.105.184/flash/my_first_tween.html (look closely at the center of the image)
Does anyone know what would cause this, or how to correct the problem?
Thanks!
Expand Text Box To Fit Content?
Hi,
I am loading various external text files with html formatting.
I have the textbox set to dynamic, multiline, render as html, characters embedded.
My text shows up fine, except it does not fit in the box.
As I do not know how much text is going to be loaded, I was hoping the text box would just expand to take whatever was loaded?
is that possible?
plus for some calculations I am getting the height of the mc containing the text box, which is not changing of course
mark
Click, And Expand Menu, PLEASE HELP :)
I am trying to learn the technique necessary to make a menu similar to this idea:
www.24-7media.de, where there are tabs on the SWF. Then when someone clicks them, the menu exapnds showcasing the content. Any help would be greatly appreciated.
Pleeeeeeeeeeeeeease
Thanks.
How Can I Expand This Function To Include X And Y
I want to add the ability to dictate where this clip goes on the x and y..... How would I do it?
Thanks.
[as]
function scaleTo(movie, targetScale, speed, tolerance) {
movie.createEmptyMovieClip("scaleControl", 1);
movie.scaleControl.targetScale = targetScale;
movie.scaleControl.speed = speed;
movie.scaleControl.tolerance = tolerance;
movie.scaleControl.onEnterFrame = function() {
this.currentScale = this._parent._xscale+(this.targetScale-this._parent._xscale)/this.speed;
if (Math.abs(this.targetScale-this._parent._xscale)>this.tolerance) {
this._parent._xscale = this.currentScale;
this._parent._yscale = this.currentScale;
} else {
this._parent._xscale = this.targetScale;
this._parent._yscale = this.targetScale;
this.removeMovieClip();
}
};
}
//then you only need to write
scaleTo(movieName, 300, 3, 1);
//whenever you want to scale something.
Expand Textinput Component
Is there any way you can expand a text input component to a fixed size when the user clicks on it? Or popup an input text box you can type into. I'm trying to create a form and need to save space so I was hoping there would be a way to just have the textinput component small but once they click on it, a box comes up where they can type more. They would need to be able to close the new box but I don't want to use popups.
Making A Line Expand
Hey im just having some simple trouble with lines. I wan't to say before i proceed that i learnt this thing by myself but the problem im having is that i can't remember how to do it. It goes like this:
Lets start with a round cirkel (draw it up and place it), then i want it to expand to a line so it looks almost like a writing effect, like im drawing with a pencil. Like this: (Phase 1) - (lets say that line is the dot) and it expands to: -----------. The line where it began doesnt move its stays, i just want it to expand forth or follow the guidlines i assign it to. I remember only using guidelines and morphing, more than that i dont know so pls help me :'(
[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];
}
|