ActionScript 2.0 :: Variable Value Not Working In Button Menu?
Dec 14, 2005
Im creating a menu navigation, which loads a sub menu movie clip from the library on specific button press. It does this by looking at the current selection (a number variable) and closing the currently active submenu. Once loaded it then changes the number variable to the value of the current submenu.
This works fine, most of the time... sometimes the number variable and menu loaded is completely wrong.
There are six buttons on the menu bar, included is sample script from the 'About' button, there is more to the script but it is instances of this sample, only button names etc change.
Code:
about_btn.onRelease = function() {
if (navID == 1) {
_root.submenuHome_mc.gotoAndPlay("close");
[Code]....
View 1 Replies
Similar Posts:
Jun 20, 2010
Basically, I have a button and on click it displays a menu. I want to click that menu a second time and the menu closes. Currently, every time you click the button, the menu reopens. I pasted the Flex livedoc example below. If you click the button, the menu keeps reopening.Now, I rigged it up by setting a var to open and closed, so when clicking the button it does a check. However, if you click away from the screen, the HIDE event gets dispatched, and the menu closes. This messed up the open close var being set.
How could I make this Flex example below show the menu on button click, and then on a second button click, it closes the menu? Take into affect that if you click away from the menu, it closes it.Also, I played around with the MOUSE_DOWN_OUTSIDE event for the button and set the preventDefault, and the FlexMouseEvent event.cancelable is set to false.Changing to a PopUpMenuButton is not an option. I have to much skinning involved.Here is the Flex example:
<mx:Script>
<![CDATA[
// Import the Menu control.
import mx.controls.Menu;
[code]....
View 1 Replies
Mar 17, 2009
I'm making my new photography site, and it's going to be entirely in flash. I'm an intermediate flash person, but there is something I'd like to do with my menu that I can't figure out how to do. I'm going to have 4 buttons:
[Code]...
View 5 Replies
Sep 16, 2011
I would not have asked the question if I owned an iphone, but so far I only have an android phone for development.
The question is: Should I use the View.viewMenuItems that are provided by flex mobile? Or should I better embed the functionality in another way? I don't know what possibilities might exist on iphone to open the menu, because it has no hardware button "menu".
By the way: How could I open the menu in the Flash-Builder mobile device emulator - there are no buttons, too..
View 2 Replies
Mar 31, 2007
I am building a menu and for each button of the menu, subbuttons apear beneath it along the menu. And I am having some problems. Each of the menu buttons has animations for rollOver and rollOut. What can I do so that when I move over the subbuttons the menu button won't start the rollOut animation. I have to extend the hit state. If I put the subbuttons in the same movie clip as the menu button, the animation would be bad because I am doing width, height, x and y tweenings with ActionScript and addind something the the clip would change these properties. Pls help.
Is it possible to extend the hit state of the menu button in some way ?
View 1 Replies
Mar 7, 2010
I want to take a static text field, convert it into a button, and use it as a button. I need it static, because I changed orientation, and I do not know how to do that otherwise. The problem is, even though I converted it to a Button symbol, it does not work when I test the movie. It works fine with "Enable simple buttons", but when I test it, the button is not there, no change in mouse cursor, no reaction at all.So this is what I did:
Made text. // static, not selectable, Orientation: vertical left to right, / //rotated; Two filters: Drop Shadow and Glow;
Converted text field to Button - Symbol (scrollBT)
Editing the Button,I put the same content (the static text field) in all four frames: No luck, not working. without the Hit frame filled (which I think doesn't really make a difference): No luck, not working.Tried again, converting the static text field in the button into a Graphic Symbol: No luck, not working.Tried again, and put some differences in the frames for "ON" and "OVER" etc.: No luck, not working.Tried again, duplicating a similar, working button, edited it, and: No luck, not working.
To the button itself and the AS: The button will be a scroll-button for a text field, with different scroll speeds on rollover and press, but nothing else. The code for that I have (I think). It's something like (and please excuse my incorrect syntax here, but I'm typing from memory; still, I use the Script-Assistant and my syntax is apparently correct; it's also working with other buttons):
on {rollOver} {
function (scroll) {
textfieldtxt.scroll - = 1;}[code]....
I'm at the end of my wits. The only difference I can tell from other (working) buttons I did the same way, is that the scrollBt does not do anything except scrolling, while all of the others have frame actions (gotoAndplay etc.) associated with them.
View 1 Replies
Apr 18, 2011
[URL]
The ad on the bottom right of the screen (the one with lightning flashing) has an invisible button in its Flash file (CS5) linking to [URL]. This file is imported as SWF in Dreamweaver CS5.
The hyperlink works in Firefox, but not in Safari. Maybe it is just my computer.
View 1 Replies
Feb 19, 2010
I use a flash header on my website with a slideshow and i want to create a drop down menu. I have created a movie clip for this menu and can get it to drop down but when i attempt to add buttons for links to other pages within the website on the menu i get errors and the menu blinks.
View 1 Replies
Feb 7, 2007
I've got the very old infinite menu posted on Kirupa's site. I haven't done anything but switch it to a vertical menu, but the problem is that I put a button in the menu, the 2nd grey box, with a getURL that just goes to google. Problem is, it won't load the url. I had wanted to put buttons in this menu to get new URLs or do things it flash, but it won't respond.
View 2 Replies
Feb 22, 2009
i have menu on main time line with "menu_mc) it is animation tween so:
- frame one there is stop()
- when over, it plays untill frame 30, so the user can click the sub buttons
- when out, it plays and stop at frame 1
these errors are: 1- the following error appears when i load another swf ReferenceError: Error #1065: Variable event is not defined. at ELI_fla::MainTimeline/loadSection() at section1_fla::MainTimeline/frame147()
2- The following error appears when i click any where after the next swf loaded TypeError: Error #1009: Cannot access a property or method of a null object reference.
[Code]...
View 4 Replies
Feb 15, 2011
I have a drop down menu but it is not working, it has buttons in a movie clip. let me know what I am doing wrong? it is coded in AS2 not I have added a winzip file of the .fla file. if I click on the menu it should go to --> about us --> history
View 2 Replies
Jan 12, 2011
i was making asimple menu .
ActionScript Code:
var currentLink:MovieClip = a_mc;
//buttons mode[code]...........
when i click on the button the alpha of this button will be 0.5 , when i click on another button the alpha of the previous button is still 0.5 , and so if i clicked on all buttons the alpha of all buttons will be 0.5,,,i didn't want that , i want when i click on the button , alpha return to 1 for the previous button .
View 5 Replies
Jan 1, 2007
i new to actionscript and am not sure where to begin so i will explin what i would like to do. i have a myspace site that i have created a div overlay with...<a [URL] now what i would like to do is use actionscript so when you click on the menu button a image wil pop up in the ipod screen and when u click the play button something else will pop up
View 6 Replies
Apr 9, 2008
I'm trying to add a back button once I click a main menu button then remove the back button once it is pressed. I get the title error.
[Code]...
View 6 Replies
Aug 3, 2008
This is something that is probably really basic but for the love of gawd I can't remember how to do it.
Example: 3 menu buttons, you press the first button and it executes a function and disables itself leaving the second and third button enabled. You then press the third button and the first button gets enabled while the third button is disabled. Same thing goes for the second button.
View 8 Replies
Oct 6, 2009
I'm having an issue with my dropdown menu, and I know how It's not working, but not why. See, I have an mc in my menu that I have a rollOver and rollOut function on. This makes it swap between frame 1 and 2 (2 beeing the frame with dropdown). Here's the issue: When I have the rollOver/Out function on the main item, the submenu items don't do anything when clicked. But when I remove the rollOver/Out function and just go directly to frame to from start, they work.
View 1 Replies
Nov 24, 2008
I'm currently learning ActionScript 3 and am having some problems getting some classes & functions that I have created to work when I put them into reusable .as packages. While I understand the basics of AS3 & OO programming I'm getting a little miffed as to why my code is not working.
I've created several AS functions such as a preloader function, reusable button function, customized context menu function etc. which all work perfectly if I place the AS code on the main timeline of the movie, like so:
=======================================
// Creates a new context menu object (myMenu)
var myMenu:ContextMenu = new ContextMenu();
// Hides the default items (zoom, quality etc.)
myMenu.hideBuiltInItems();
[code]....
I don't get any error messages, but the customized context menu (with default items removed) is not appearing when I compile the movie.
My initial thought was that the script might not be running through, so I put a trace in, if I uncomment that line of code I get "testing" on the screen so the fuction is running through.I have a feeling, and I could easilly be wrong, that its because my "this.contextMenu = myMenu;" action is not attached to the main timeline so cannot display the customized context menu. If I'm right, how would I go about getting the action to attach to the main timeline.
View 4 Replies
Jul 26, 2009
The following code is from the CS3 Language Reference.Pasted into a new file it works.Pasted into my current project it doesn't.what settings I might have that are disabling it?
this.createTextField("news_txt", this.getNextHighestDepth(), 10, 10, 320, 240);news_txt.border = true;news_txt.wordWrap = true;news_txt.multiline = true;news_txt.text = "To see the custom context menu item, right click (PC) or ";news_txt.text += "control [code]....
View 7 Replies
Aug 11, 2009
I'm having a bit of trouble getting a button in a hoover over drop down menu to link to another scene in the .swf movie. I just doing a basic drop down menu (example here: [URL] with a couple of buttons with in a movie clip, the movie clip being the "button" someone hoovers over. The buttons however are not going to the corrisponding scene I have them set up to. What's strange is that if I set in the buttons action panel to go to an url instead of a scene, in the .swf movie the button works when I click it...it wants to go the specificed url. Nothing happens when it's set to go to a scene.
View 5 Replies
Jan 6, 2010
My problem is that I just recently start working on the company website. They a have menu bar on the side of the website. Some of the links dont work. Where would I find the hyper links in the file to change them to make them work?
View 5 Replies
Dec 11, 2009
Ive got my main menu inside a movie but i cant get the buttons to work in 'scene 1' the AS is in scene 1.
ActionScript Code:
stop();
menuMovie_mc.contact_btn.addEventListener(MouseEvent.CLICK, onButton1Click);
[code]....
OUTPUT
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at index_fla::MainTimeline/frame25()
View 3 Replies
May 20, 2007
I have a flash movie with a hidden menu. The hidden menu will appear whenever theres a rollover at the portion that says 'quick menu' . This portion of the quick menu btn is visible to users.
Now here's the problem: After writing the OnRollOver tween for ._y , the individual btns on the menu stop working, the trace dun even work !!!!
Here's the sample(.swf) and working file(.fla) http://www.greenimagination.com/preview/pacodis/scope/ .
View 3 Replies
Nov 18, 2008
How do I lock my menu from working when a mc appears over them? They can't be seen at all, though Im still able to click on them which is not good.
View 1 Replies
Jul 20, 2010
I am using a scroll bar for a menu. However, I keep getting error 1120. I selected all of my menu buttons, and created a new symbol, with instance name "content". When I compile, I get 1120, error Access of undefined property. I am assuming this is because, my buttons are now associated with the scroller content area. My question is basically, how do you get buttons to work inside of a scroll area?
Code:
liberated.destination=this.currentFrame+2;
liberated.returnme_sound=new m_liberated();
liberated.returnme_song=s_liberated;
View 1 Replies
Nov 8, 2004
so heres the deal i have a drop down menu that for some reason is not picking up button presses, im starting to think its because the drop down menu is within another movie clip, but its driving me nuts, any reasons why an embeded movie clip wouldnt be picking up a hitTest or a this.onRelease ??? ahh driving me nuts heres my code im using the undocumented tween class
onClipEvent(load){
//portfolio dropdown
this.onRelease = function() {
[Code].....
View 2 Replies
Feb 14, 2006
I'm getting there with making the hga menu conect to MySQL, just a couple of things, I'm trying to pass a variable through the menu, so I have added another variable, mypage.
[Code]...
View 1 Replies
Jun 23, 2011
I write a flex application. I added some custom menu items in context menu. when I compiled this code using flashplayer 10.0, it works fine and my added context menu items are shown when I Right-Click. But when I compile same code for flashPlayer 10.1, menu items that I added in context menu are not shown when I Right-Click. I am using sdk 3.5.
I am doing this;
private var cm:ContextMenu = new ContextMenu();
var versionMenu:ContextMenuItem = null;
var dateMenu:ContextMenuItem = null;
if(model.appVersion.length > 0) {
versionMenu = new ContextMenuItem(model.appVersion);
[Code] .....
View 2 Replies
Feb 9, 2004
I'm building a small XML menu where I want to call a function for each subitem's onrollover
part of my code:
[AS]
//*** build submenu items ****
for (j=0; j< numSubItems; j++){
curSubItemName =
[Code].....
The menu gets populated from the XML file, no problem. However, the onRollOver simply isn't working, but why?
View 12 Replies
Jan 28, 2010
I want to be able to have a number displayed on the screen that when one of the arrows next to it (up/down) is clicked it adds 1 to the original number (lets say 72). Then when they click the "save" button that really just takes them to the next frame (or a frame somewhere else in the movie), which is a confirmation page, I want the number they ended at to display on the confirmation screen.
I'm thinking that it is partially because I don't know what to search for.I know I have to create a variable and get the button to add one to that variable.
View 2 Replies
Aug 7, 2009
In the code below, I'm looping through nested xml structure of an unknown number of levels. GenMenu is (or will be) a recursive function that will build each level of the menu. My problem is that I can't figure out how to reference the variables from an eventlistener function. I need to pass the children node_xml[i] to the next recursion, as well as set hover styles on the menu links, etc...
Code:
function GenMenu(container, name, x, y, depth, node_xml) {
// variable declarations
var curr_node = new Array();
var curr_menu:MovieClip = new MovieClip();
addChild(curr_menu);
[Code] .....
View 2 Replies