Actionscript 3.0 :: Button Navigation Through Class?
Nov 24, 2010
I got a Website.as file that loads 4 library's movie clip's on the stage in certain positions.Clip_A, Middle, Menu, Clip_D Clip_A loads on the top left side , Menu on top right , Middle in Middle and Clip_D low right position.What i need to do and understand is how can i tell this class to find a button inside Menu and play a certain frame in Middle?I added this code in Website.as but i get errors
menu.menu_buttons.about_us.addEventListener(MouseEvent.CLICK, about_us_onClick);
function about_us_onClick(event:MouseEvent):void
{
middle.gotoAndPlay(215);
}
the error i get is this
1046: Type was not found or was not a compile-time constant: MouseEvent.How can i make this work?
View 10 Replies
Similar Posts:
Jan 28, 2008
// This is an array, a list of the buttons used. var myButtons = [this.myButton_1, this.myButton_2, this.myButton_3, this.myButton_4]; // Loops on all buttons from the first to the last one for (var i=0; i<myButtons.length; i++) { // When the mouse rolls over this menu option... reduce size just a bit. // NOTICE: I'm not taking into consideration the problem of having the hit area going down and "moving" the // mouse area and out of the button (possible rollover flicking). This is just a simple example afterall.
[Code]...
In the above instance how would I address the problem of flickering? I think want to apply the .onRollOver to an invisible button instead. How can this be done? Im just getting started with tweening animations outside the timeline with MCTween
View 5 Replies
Nov 4, 2010
I'm using flash for the first time to create my graphic design portfolio and I'm having trouble keeping the file size small, and can reduce it by (hopefully) doing the following:
My resume has a lot of classic tweens with alpha channels (to create fadein/fadeout effects) and as of right now, I need to create a separate layer of fadein, fadeout for each transition. IE: My resume to portfolio page needs one 20-frame transition, my portfolio page to resume needs a 20-frame transition, my 2nd page of my portfolio page to my biography needs a 20-frame transition, etc. It's getting out of hand.
I could easily remedy this by using a lot of separate fadeins fadeouts and then coding buttons to navigate from, say, frames 120-130 (resume fadeout) then go to frame 160-170 (biography fadein), then navigate to a static page. I'm not sure if this is possible, as my buttons would have to change functions each frame.
Another possible way is that currently for each button I have different layers in order to direct the button to different frames, and have placing hem in the same spot. I'm wondering if there's any way to have buttons go to separate frames on different frames, if you get what I mean (on frame 120 it'll go to 130, on frame 150 it'll go to 160 but still be the same button". Right now each button is coded with on release gotoandplay <frame>.
View 1 Replies
Feb 16, 2009
I want to build a flash based website and place there 4 button MovieClip instances. Once the user clicks a button, all the EventListeners the button attached to (Mouse_OVER, Mouse_OUT, CLICK) are removed until you click another one. Then the previous button gets these listeners back again. One button is always active at a time, so you can't turn on/off buttons.I thought it would be easier to write a ButtonClass and link the button MovieClip to it. But I had to realize that I can't listen that previous button from that class, because it only listens itself obviously. I'm trying to use "dispatchEvent" but I can't get it to work.In the flash movie I have only one frame, 'cause I'm trying to do this without the timeline. I want to use Classes and this and that to practice but I'm stuck with this problem.
View 3 Replies
Feb 17, 2006
I have used this navigation script several times in regular flash coding without problems (as in functions). Now I'm trying to put this code in a class for easier usage in future projects.Concept of the code is that I pass the instance of the mc in an variable so that I have an old and new location for enabling and disabling a "ON" state in an mc (vars : OldLocation && NewLocation).This is pretty basic stuff but I can't get it to work inside a class..Offcourse at the first click you will get an undefined because of no instance defined yet (I define it in the fla file).[code]
View 2 Replies
Apr 14, 2007
how this sort of navigation works: [URL] (you have to enter the site). I see this sort of thing used a lot and I would like to implement a simple version of this. I am assuming it is using the tween class and moving a movie clip based on coordinates.
View 7 Replies
Sep 17, 2009
So I want to create a timeline nav like this site:timeline is a 40 x 40px color filled movie clip that use as the playhead.featContent is the movie clip that contains the feature content.I make the timeline controls the feature contents to slide (using tween class) to the next feature. No problem on this, but I can't make the feature to slide when click on the button.
Code:
function loadFeature(node){
var m = 0;
[code]......
View 0 Replies
Jun 6, 2009
I'm hoping someone here has a couple suggestions for a generic navigation class I'm working on. I got it to work exactly how I wanted it to, but maybe someone can think of some ways to make it better. [code]
View 2 Replies
Jul 31, 2009
I hope this isn't faux pas, but I'm making the transition from AS2 to AS3 and was wondering if I'm on the right track with this class. One question in particular I have is, I'm storing a reference (I think it's just a reference and not a copy) of "curTab" in order to keep track of the currently selected tab in this UI navigation. Is this using unnecessary memory and is there a better way to do this?
[Code]...
View 7 Replies
Feb 12, 2010
I'm currently putting together a navigation that will be XML driven. The broad outline of what I'm trying to do is:XML > Custom XML parser class > Native Actionscript representation > Abstract Navigation Class > Concrete Navigation Class.The concrete Navigation class would have setter methods to allow you to skin it's appearance using display objects.
Code:
setButtonUpState(upState:DisplayObject)
This is fine if the Display object is purely Class based and draws itself programatically,
[code]......
View 0 Replies
Aug 13, 2011
this is the scenario...
main timeline---> two movieclips
in one of the movieclips (which is navBar_mc) i have my buttons in a drop down menu. so it is one level deep i am guessing.in the other movieclip (content_mc) i have the content that is to be manipulated by pressing the buttons.what would the code look like to target the content? i know i have to go up a level and then address the sibling mc, but when my code looks like this....
-----same---up-----over------------down-------------target
-------|-------|-------|-----------------|-------------------|
------this.parent.content_mc.nestedcontent.nestedcontent
it finds the main timeline ok, but when i address the sibling mc on the same level, it gets lost.
View 1 Replies
Jul 7, 2009
I need to make a navigation bar using flash. how to use a button symbol.
View 1 Replies
Aug 1, 2011
i want the main page to drop off after button press
View 2 Replies
May 24, 2010
I would like to start out by saying I am very new at this and am working on a portfolio website in flash CS4 and currentlyhrough the tutorials over at Now my problem is In the portfolio section I want a preview of the pics like a thumbnail on the bottom with a scroll bar to scroll through them all, but at the same time I would like to have buttons to navigate through these photos at the same time. I have got it to work, the only problem is let say i'm using the buttons to navigate through but then stop and go to the scroll bar on the bottom and click on one three of four pictures in front of where I left off, The image loads and everything is fine but when I go back to the buttons it continues off from where it last left off not where I clicked on the scroll bar.Here is the code that I currently have:
myscrollpane.source=allthumbnails;
//load the thumbnails...
var thumbLoader:Loader = new Loader();
[code].....
View 3 Replies
Nov 9, 2009
I am a total newbie with AS, I have this error.. TypeError: Error #1009: Cannot access a property or method of a null object reference. at all_new_fla::MainTimeline/frame1()
[Code]...
View 2 Replies
Feb 12, 2011
I have created a simple navigation bar that has 6 buttons. the bar was created using movie clips then by putting an "invisible" button underneath. as for the action script:on the main stage in an actions layer i have:[code]I have this code for every button, except the names of the movie clips change. All the movie clips do for now is have a graphic go from black to red.The action script for the buttons are as follows:[code]Now when i play the clip everything works like i want it to work...The problem arrises once i load the bar into my header.What I have done is created a new file which contains my header... I added a layer called load with a blank movie clip with the instance name of load_mc in another layer called actions I added the following action scripts:[code]When I play this file, my button_bar.swf load but the graphic keeps playing over and over again instead of only playing on mouse over.
View 6 Replies
Mar 8, 2011
I'm trying to make a navigation with 8 buttons, each represent a year and I want that initially there is one selected and highlighted and then everytime the user clicks on a different button the selected one will be highlighted and the previous one selected will be back in normal state (on/off).[code]...
View 1 Replies
Apr 12, 2009
http:[url].....This website is great.They have a navigation bar whereby a user must click on it, and shake it, to proceed to the other page. I can implement it into my website.
View 5 Replies
Mar 3, 2009
I have a nested movie 1 layer down from main stage that has several navigation buttons that move to different main stage labeled frames. I get an 1120 error because I am somehow not calling them out on the script. I have named the instances..so that's not the problem. I think I just need to somehow direct the script to the nested location. If I move the buttons to the main stage I get no errors and it all works perfectly.
View 7 Replies
Dec 13, 2011
Navigation to new sceen through button click in as2
View 5 Replies
Mar 15, 2006
On a particular frame I have the action
PHP Code:
loadMovie("swfs/home_text.swf", 1);
I want to add an action on a navigation button to unload that movie from main movie. I tried unloadMovie();, but no luck.
View 3 Replies
Sep 28, 2007
so i am working on some buttons that are arranged in a vertical group. When you click on one it expands pushing the others away, and collapsing when clicked again bringing them back together. I thinking it would be easiest to make each button how i want it, then have some code that keeps each button x pixels away from each other...make sense?
View 1 Replies
Jul 13, 2009
How i can make flash navigation button only using Action scirpt 3.0 can some one give me tutorila links
View 2 Replies
Sep 25, 2009
Making buttons that open another url is easy enough, but for some reason I'm having a huge amount of trouble having a navigation button open new content on my website, such as moving from the Home content to the Menu content (the layout is static, only one small section filled with content changes.
I think the issue is that I can't figure out how to code it due to the fact that there are a good amount of nested movie clips, I'm not sure how to direct it to the place and frame I want.
I couldn't quite uplaod the file, so I've got it on filefront here: [URL]
View 2 Replies
Oct 1, 2009
I'm using CS4 with AS3 and have a little problem with my rewind and forward buttons. For the play and stop buttons it works fine with this script:
playButton.addEventListener (MouseEvent.CLICK, playButtonClick);
function playButtonClick (e:MouseEvent):void
{
play();
[Code]....
I get error messages.
All I need is to rewind and forward the movie about 50 frames and keep playing without stopping.
View 2 Replies
Oct 4, 2003
I have a sliding menu (who doesn't these days? ) at the bottom of my screen. When you mouse over the menu it pops up and as it does it triggers an animation of a moving object. The moving object starts "off screen", comes sliding in and comes to a rest in the middle of the menu. The object has buttons on it. What I'd like to do is when a user clicks the button it loads content onto the main stage. Then either after clicking the button or mousing off the menu the object animation will continue on it's merry way out of view (off the menu).Everything works great except I can't get the **** button to work!I'm thinking it's a path issue since I've done lots of buttons.So the button is now here:_root.slidingNav.animationMC.object.buttonand I've got the AS on the button:
on (release) {
_root.slidingNav.animation.gotoAndPlay(31);}
Is the button so buried that it's clicking options aren't available? I've never heard of that before but I'm still new so .
View 14 Replies
Apr 22, 2010
I want to have an object move towards the active button on a navigation. So if I click on a button, the object moves towards that button and stop there. Then if I click on another, it move towards it and stop.I looked online but I have a hard time finding the right words to find what I need..
View 3 Replies
Apr 19, 2010
I am just trying to write a small actionscript in Flash CS4 for a navigation button and I am really lost.
I turned Script Assist and can not figure out even the first line nor can I turn Script Assist off. Should I be using Script Assist and, if not, how do I deactivate it so that I can type directly into the text box?
View 9 Replies
Aug 12, 2010
I installed a flash template. It has navigation buttons with a nice roll-over effect. The buttons are all located within a symbol called "menu" (it is a Movie Clip type symbol, not a Button type). Each individual button in the menu appear to be in its own separate layer, so the first button is in a layer called "item1, second button in "item2", and so on. I want to edit the link for the fourth button so it goes to another website but I can't seem to find the code to edit the link. I managed to find
[CODE]...
and this does work - upon pressing the button it goes to the website link. However, there is no more roll-over effect for this button. So there has to be an alternative or better way to editing the link for this button (without removing the roll-over effect).
View 3 Replies
Oct 12, 2010
How do I make a button created in CS4 flash open another page in my website?
I created the button in flash cs4 with a static state and a pulsing state on "Over" and "down" that works fine. I tried adding the following action to the button>
on (press) {getURL("aboutus.html?include=contact","_self");}
but nothing happens when I view it in live view. and all the pages exsist in the file. (Using Dreamweaver CS4 to build webpages.)
View 5 Replies