Collapsing menu from array
I need to create a dynamic collapsing menu from an array. so
far I have the array and first level of the menu working. Now I
need to create the functionality of the subMenu and I am stumped.
Is there any good references out there that might be able to walk
me through this process? Here is my code and my source file can be
found here
http://www.actionscript.org/forums/showthread.php3?t=122921
Sorry I noticed errors in code and in the fla. If you have
looked at this please check out the new one. The nested array is
partially loading but then I loose the links that are above it.
Here is the updated fla which can be found at the link above and
code
Similar Messages
-
Remove text field from Array via for loop
Hi,
i have a problem to remove text fields added via for loop.
That im doing is, via for loop im dynamically creating menu with 10 buttons.
Each button contain, dynamically created, background (shape) and text field.
And everything is fine.
But when im try to remove text fields then i got this error:
- Im using button to remove text fields - lang_btn.addEventListener(MouseEvent.CLICK, clickHandler);
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Loading_Img_fla::MainTimeline/xmlLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
In the script bellow marked with red is what should remove text fields from an Array, instead giving me error.
Here is my script
// Create for loop
for (var i:int = 0; i < 10; i++)
for each (xml in listItems)
if (i == xml.attribute("Id"))
// Add MovieClip to stage to hold the data
addChild(lmHolder);
lmHolder.x = 0;
lmHolder.y = 0;
// Create new MovieClip to hold buttons
lmButtonsMCArray[i] = new MovieClip();
lmButtonsMCArray[i].buttonMode = true;
lmButtonsMCArray[i].mouseChildren = false;
lmButtonsMCArray[i].x = 20;
lmButtonsMCArray[i].y = 20 + btCount * buttonSpace;
// Add each button MovieClip to lmHolder MovieClip
lmHolder.addChild(lmButtonsMCArray[i]);
// Create Background to buttons
lmButtonsArray[i] = new Shape();
lmButtonsArray[i].graphics.beginFill(lmBgColor0, 1);
lmButtonsArray[i].graphics.drawRect(0, 0, 230, 85);
lmButtonsArray[i].x = 0;
lmButtonsArray[i].y = 0;
// <<-- Add Background shape to the buttons MovieClips
lmButtonsMCArray[i].addChild(lmButtonsArray[i]);
// Create a new array to preserve data from XML List
lmNameArrayEG = new Array();
lmNameArrayUS = new Array();
// Create local variable to hold
var lmTxtFieldContentUS:String;
var lmTxtFieldContentEG:String;
var lmTxtContent:String;
// If clicked button is EG then make array with Arabic text
// If clicked button is US then make array with English text
if (footer.lang_btn.langState == "EG")
for each (var leftMenuName:XML in egLanguageList)
lmNameArrayEG.push(leftMenuName);
lmTxtFieldContentEG = lmNameArrayEG[i];
lmTxtContent = lmTxtFieldContentEG;
else
for each (var leftMenuNameUS:XML in usLanguageList)
lmNameArrayUS.push(leftMenuNameUS);
lmTxtFieldContentUS = lmNameArrayUS[i];
lmTxtContent = lmTxtFieldContentUS;
// Setup new text field each time script is executed
lmTxtFieldsArray[i] = new TextField();
lmTxtFieldsArray[i].width = 110;
lmTxtFieldsArray[i].border = false;
lmTxtFieldsArray[i].wordWrap = true;
lmTxtFieldsArray[i].multiline = true;
lmTxtFieldsArray[i].selectable = false;
lmTxtFieldsArray[i].embedFonts = true;
lmTxtFieldsArray[i].antiAliasType = AntiAliasType.ADVANCED;
lmTxtFieldsArray[i].autoSize = TextFieldAutoSize.CENTER;
lmTxtFieldsArray[i].text = lmTxtContent.toUpperCase();
lmTxtFieldsArray[i].x = 10;
lmTxtFieldsArray[i].name = "lmTxtFieldName" + i;
// <<-- Add Text fields to the Movie Clip
lmButtonsMCArray[i].addChild(lmTxtFieldsArray[i]);
// If clicked button is EG then set Arabic text format, and make array with Arabic text fields
// If clicked button is US then set English text format, and make array with Egnlish text fields
if (footer.lang_btn.langState == "EG")
lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_eg);
// Make array from text fields;
pushEgTFintoArray.push(lmTxtFieldsArray[i]);
else
lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_us);
// Make array from text fields;
pushUsTFintoArray.push(lmTxtFieldsArray[i]);
// If clicked button is EG then loop thrue the for loop and remove English text fields from array
// If clicked button is EG then loop thrue the for loop and remove Arabic text fields from array
if (footer.lang_btn.langState == "EG")
for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
//remove the text field array from the display
removeChild(pushUsTFintoArray[rNr_us]);
//clear the array
pushUsTFintoArray = [];
else
for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
//remove the text field array from the display
removeChild(pushEgTFintoArray[rNr_eg]);
//clear the array
pushEgTFintoArray = [];
btCount++;it looks like those tf's are children of lmButtonsMCArray[i], not the current scope. use:
if (footer.lang_btn.langState == "EG")
for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
//remove the text field array from the display
lmButtonsMCArray[rNr_us].removeChild(pushUsTFintoArray[rNr_us]);
//clear the array
pushUsTFintoArray = [];
else
for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
//remove the text field array from the display
lmButtonsMCArray[rNr_eg].removeChild(pushEgTFintoArray[rNr_eg]);
//clear the array
pushEgTFintoArray = []; -
Memory/Speed of Split 1D array vs Delete from array
Just wondering how Split 1D array works - does it create two new arrays in a new section of memory or does it just split the existing array in two, reusing the memory in place. (assuming that the original array is not needed elsewhere). If the latter is the case then presumably it is more efficient to use split array than delete from array if I want to remove element(s) from the beginning or end of the array. Is there a speed advantage as well?
If I use split array but don't then use one of the output arrays is that memory deallocated or does the array remain in memory?
Thanks
DaveOk please ignore the results I posted earlier, they are rubbish - not least because I got the column headings mixed up but also because my code was full of bugs
So, here is a revised table, and the code - which hopefully only contains a few bugs... I'm not clued into benchmarking yet so please feel free to rip the code apart.
I still get different results depending on where in the array I split it, most noticeably with subset and reshape. There is no effect with split. I'm guessing this is to do with the memory allocation. (I have not preallocated memory in my code, but I did wire the output arrays to Index Array)
Message Edited by DavidU on 08-12-2008 04:49 PM
Attachments:
Benchmarks 2.png 13 KB
split array test.vi 25 KB -
How can I create a rollover drop down menu from a link in Dreamweaver CS5?
Hello all, I am working on a portfolio website and I was just wanting to know if there is any way that I can create a drop down menu from a text link that cascades once the cursor has made contact with the link. I would like to have it in my navigation bar where the Portfolio link is. Basically, my navigation bar looks like this : Home | Resume | Portfolio | Contact. I only want three items on the drop down menu beneath the portfolio link: Traditional Art, Photography, Graphic Design. I would really appreciate any help I can get! Thanks!
Have a look at what Nancy does http://alt-web.com/DEMOS/CSS-Horiz-menu-2.shtml
-
The dropdown menu from the Creative Cloud icon on the menu bar keeps giving me the following message: "Download Error" I quit and restarted the creative cloud app to no avail. Running Mavericks on a mid 2011 iMac.
Try below steps once
click Gear icon on the top Right corner and Quit Creative Cloud App
Click on Finder and then hold Command + Shift + G keys on your keypad
It will open Go to folder window, type exactly ~/Library and click on Go
Make sure to open ~/Library not /Library ( there will be two Library folders )
Then open Application Support > Adobe folders
Trash AAMUpdater and OOBE folders.
Then launch Creative Could and check. -
Is there any way to prevent the right click context menu from combining Stop/Reload?
Is there any way (about:config tweak, or something) to prevent the right click context menu from combining Stop/Reload?
Screenshot of what I'm talking about: http://picsend.net/images/873089StupidReloadSto.pngI did try the add-on ''Menu Editor'' https://addons.mozilla.org/en-US/firefox/addon/menu-editor/ but even when I separate the navigation reload and stop icons and explicitly have both stop and reload set to be visible on the right click context menu I only get the one option showing.
Whilst there may be some way of changing this I do not know how to and I do not really see any use case for making such a change. Only one option of the choice: stop or reload, is available at any instance in time, but that is the option you are able to use, the other option is not active and so is not displayed. -
Creating a dropdown menu from an image hotspot
How do you create a dropdown menu from an image hotspot? For
example, this website is a single jpg image with links generated
from hotspot coordinates on the image. Can I have someone click on
a hotspot and a dropdown menu appears?
Thanks in advance for the help!Unfortunately, everyone knows, but nobody wanted to tell you.
Given this fact -
> this website is a single jpg image with links generated
from hotspot
> coordinates on the image.
one can assume that you are not very experienced with DW or
even with HTML.
In that case, the practical answer to your question would be
"no".
To create a 'drop-down' menu, you need to have a full web
page (not just an
image with image maps), containing a menu HTML structural
element. While
you *could* just place hidden elements on the page that would
only be
revealed (i.e., drop-down) when your image maps are rolled
over, the
practical reality is that this would be an extremely awkward
construct, and
not only most likely beyond the ken of someone who is
inexperienced, but
also just plain 'not right'.
Sorry to give you the bad news.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"dimplechin" <[email protected]> wrote in
message
news:g0kdnk$cn1$[email protected]..
> No one knows? -
Writing data from array to file
May i know how to write string from a array into a file.
I have use string tokenizer to extract every line from a file using readline and use stringtokenizer to spilt the line using tab delimiter for processing.
But if i want to write data from array to file with tab as a delimiter and how to go to the next line. How do i do that. Below is the task and i have state a simple example on a array i have and the file output that i want.
Pls advice.. Thanks
eg of a array
array[0] = Data
array[1] = One
array[2] = Data
array[3] = Two
array[4] = Final
array[5] = Data
From the above array, i want to write to a file so that it will appear something as below
Eg textfile.txt
Data One
Data Two
Final Data
PLs attached a simple code as a example as i am only begining to start useing the IO feature in java. ThanksReally thanks for your help,
but u are mentioning that i have already know the number of countters in advance , that is to say the 2 * counters.
But is there a way to solve this problem which i mean if i dun know the number of predefined counters. Maybe i should say, there is more than 2 counters and in another situation, the counters will only be defined during runtime. Actually the solution u give will work nicely with 2 counters. but wat if the counter is more than 4, i wll have to concatenate the string a lot of time. so is there any solution around this problem. That why i am wandering if tere is any solution to write to the file when the counters can be only determined in runtime
Pls advice on the above with a code samples if possible. -
How do I stop the menu from showing up when I hover to the top of a full screen app?
I am running Parallels in full-screen on Lion and when I move the cursor towards the top of the full screen app the menu pops up. How do I stop the menu from popping up? I keep hitting an icon on the menu bar that pulls it out of full screen mode and it's getting very annoying. Thanks.
Use VMware Fusion? But seriously, Fusion does what you want. It just puts a mini VM control menu at the top when running full screen (and that's configurable, too), so the main menu bar doesn't appear at all. Which means that it's up to Parallels to handle this. Are you running Parallels 7, which is designed for Lion? If you are and Parallels still doesn't offer something similar, you need to contact Parallels.
-
Ichat drop down menu from menu bar shows up in the wrong place.
I'm not sure how this happened, but for some reason, ever since I've moved to college, my Ichat drop down menu from the menu bar shows up on the left side of my screen, and you can only see half of the menu. I don't know how to fix this problem so if anyone could help me out that would be great.
Sincerely,
Cody MartinYep.
Go to the Buddy List Status Message and option the Edit option.
Delete that Status Message that you have that is over 42 characters.
Ones of about 60 or more will introduce the "Left Shift" (And the fact the drop Down may line up with the right hand edge of the Menu Bar icon on in-between lengths)
In Snow Leopard it is possible to have a Long Message that displaces the Drop Down Off Screen.
The other factor is the order of the Menu Bar Icons on that side of the Screen
The iChat one can be Dragged if you use the Apple (CMD) key.
If the Drop Down can not fit the message in before the right hand edge of the Screen it will displace.
Having a Second mac User Account and deciding to Display which mac User is Logged in can give you some extra "space"
3:24 PM Sunday; October 11, 2009 -
Removing menu from Flash video in Dreamweaver
I have used the Flash Encoder to convert some videos to FLA.
I am now using Dreamweaver, "Insert->Flash Video", to add a FLA
file to a web page. I got the video in fine and it plays on the
page just fine. I would like to remove the menu from the video, but
there is not an option in properties to select "none" for the flash
video menu. I also tried changing the attirbute
"&skinName=SteelExternalNoVol" to "&skinName=none" and that
made the flash video not show up.
I would also like to loop the video and that option is not
available in the Dreamweaver menu.
My code is
<script type="text/javascript">
AC_FL_RunContent( 'codebase','
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','widt h','375','height','250','id','FLVPlayer','src','FLVPlayer_Progressive','flashvars','&MM_Co mponentVersion=1&skinName=SteelExternalNoVol&streamName=portfolio/videos/3d_graphics&autoP lay=true&autoRewind=true','quality','high','scale','noscale','name','FLVPlayer','salign',' lt','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','FLVPlayer_Progres sive','wmode','transparent'
); //end AC code
</script>
<noscript>
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="375" height="250" id="FLVPlayer">
<param name="movie" value="FLVPlayer_Progressive.swf"
/>
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="scale" value="noscale" />
<param name="FlashVars"
value="&MM_ComponentVersion=1&skinName=SteelExternalNoVol&streamName=portfolio/videos/3d_ graphics&autoPlay=true&autoRewind=true"
/>
<embed src="FLVPlayer_Progressive.swf"
flashvars="&MM_ComponentVersion=1&skinName=SteelExternalNoVol&streamName=portfolio/videos /3d_graphics&autoPlay=true&autoRewind=true"
quality="high" scale="noscale" width="375" height="250"
name="FLVPlayer" salign="LT" type="application/x-shockwave-flash"
pluginspage="
http://www.macromedia.com/go/getflashplayer"
/>
</object>
</noscript>Could someone tell me if I should be able to add parameters
to this code and get results. I have found mention of values like
<param name="loop" value="true" />
but when I used it nothing changed on playback. -
In iTunes I'm having problems changing the "Media Kind" in the OPTIONS menu from "Music" to "Audiobook". After going through the steps, the next time I check, the items have reverted back to "Music". What must I do to save it as an "Audiobook"?
After more digging in the Support section here and some Google work, I turned off iTunes Match and lo and behold! I can change the media kind to Audiobook! So, it looks like iTunes Match locked the files up somehow and for some reason.
I went into iTunes Store > iTunes Match > "No, Thanks" to disable it on the local PC. -
How to deploy Forms, Reports and Menu from Client to Server machine
Dear Experts,
I have one requirement to deploy the Forms, Reports and Menu from client machine to server machine.
Deployment involves the following steps :
1. Firstly we have to search the selected file in a folder where the .fmx is present ( in Server machine) and take the back up of the the existing file in the server (Source and destination paths will be available).
Ex. If the existing FMB name is TEST.fmx then the backup file should be TEST_sysdate.fmx.
2. Secondly we have to transfer the file from the client folder (or from another folder of the same server) to the server folder where the back up exists.
Please help me to search/rename/copy/replace the _.fmx/.rdf/.rep/.mmx_ files from client to server.
We are using
9i Database.
10g Forms and reports.
SQL Developer tool.
OS is Windows (Client and Server).
Help me out to attach a file of front end screen which we are planning to develop. It will give a clear picture on this requirement.
Thanks :)
Edited by: 941175 on Jun 17, 2012 9:09 AM
Edited by: 941175 on Jun 17, 2012 9:12 AM
Edited by: 941175 on Jun 17, 2012 9:14 AM941175
Welcome to the forum. Please take a while to go through the FAQ to be found to the top right of the page.
Your issue is more to do with batch files rather than Forms. The only relation with Forms, as I see it, is that you will be using HOST/CLIENT_HOST to start a batch file with the file name to be deployed as a parameter passed to it.
You need to rewrite either a CMD batch file or a Powershell script to achieve what have set out to do.
For CMD batch files look up http://www.robvanderwoude.com/battech.php , or any of the other excellent resources available on the internet.
Regards, -
I have a mac which doesn't support the new itunes. The instructions I have from apple say that I have to use a pull down store menu from the itunes store and then I should be able to view my account and cancel by turning off the auto renew button next to itune match, The only trouble is I can't see the itune match at all.
Turning off the auto-renew does not cancel the service. To actually cancel, or turn off the service, you need to contact iTunes Store support. What the instructions are are getting is telling you to do is to cancel the auto-renew. You can accomplish that by, in iTunes:
1. Pull down the Store menu and select "view account."
2. Enter your credentials when prompted.
3. In the middle of the page click the hightlight button: -
Removing menu from Flash video
I am using Dreamweaver to add a fla file to a web page. I got
the video in fine and it plays on the page just fine. I would like
to remove the menu from the video, but there is not an option in
properties to select none for the flash video menu. I also tried
changing the attirbute "&skinName=SteelExternalNoVol" to
"&skinName=none" and that made the flash video not show up.
thanks
AllenI have left the question in the Flash forum for almost a
week, but not even a "Hey get a book and a clue"
I am posting it back in Dreamweaver to see if someone has any
ideas. Right now I just would like to loop the video. I found a
small menu that is not too obstructive.
I have used the Flash Encoder to convert some videos to FLA.
I am now using Dreamweaver, "Insert->Flash Video", to add a FLA
file to a web page. I got the video in fine and it plays on the
page just fine. I would like to remove the menu from the video, but
there is not an option in properties to select "none" for the flash
video menu. I also tried changing the attirbute
"&skinName=SteelExternalNoVol" to "&skinName=none" and that
made the flash video not show up.
I would also like to loop the video and that option is not
available in the Dreamweaver menu.
My code is
<script type="text/javascript">
AC_FL_RunContent( 'codebase','
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','widt h','375','height','250','id','FLVPlayer','src','FLVPlayer_Progressive','flashvars','&MM_Co mponentVersion=1&skinName=SteelExternalNoVol&streamName=portfolio/videos/3d_graphics&autoP lay=true&autoRewind=true','quality','high','scale','noscale','name','FLVPlayer','salign',' lt','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','FLVPlayer_Progres sive','wmode','transparent'
); //end AC code
</script>
<noscript>
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="375" height="250" id="FLVPlayer">
<param name="movie" value="FLVPlayer_Progressive.swf"
/>
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="scale" value="noscale" />
<param name="FlashVars"
value="&MM_ComponentVersion=1&skinName=SteelExternalNoVol&streamName=portfolio/videos/3d_ graphics&autoPlay=true&autoRewind=true"
/>
<embed src="FLVPlayer_Progressive.swf"
flashvars="&MM_ComponentVersion=1&skinName=SteelExternalNoVol&streamName=portfolio/videos /3d_graphics&autoPlay=true&autoRewind=true"
quality="high" scale="noscale" width="375" height="250"
name="FLVPlayer" salign="LT" type="application/x-shockwave-flash"
pluginspage="
http://www.macromedia.com/go/getflashplayer"
/>
</object>
</noscript>
Maybe you are looking for
-
Running Firefox 33.0 on Windows XP. Problem suddenly appeared last week. I made no configuration changes..
-
I have recently continued to have an "Error: 16" code when trying to load any of my Adobe CS5.5 Master Collection suite. Every time I try to use any of the applications within the Master collection and then the Adobe Application (installation softwar
-
Measure definition not displaying in portal - balanced score card
Hi, Please help very urgent!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I have just transported the balance score card from development to quality. When i tried to open the balance score card via portal i am unable to see the measure definitions. I transported th
-
CS5 transform camera raw smart object with mask funniness?
When I try and trasform a camera raw smart object that has a layer mask, the trasform box is not the size of the image, but is about a quarter of the image and it moves up to the upper left quarter of the image. If I first rasterize the smart object
-
I am very new to JAVA. I am building a GUI where I need each of a set of menu buttons to build a tree. I am having problems with the event handling part of JAVA because I need to build not a static tree but on that's built as a result of clicking the