Actionscript for nav buttons

hi guys,
how can i set some actions to the buttons in my navigation so
that when clicked, it plays an animation. when it gets to the end
of this animation i want the movie to play another animation that
leads into the next section of the site, depending on which button
was clicked.
so basically if youre in a section of the site (say news),
when you select another section to go to (eg. contact), an
animation will play that gets rid of all the news stuff on the
screen and then comes back in with the contact animation - as to
not have a direct cut to the next scene.
i dont want to make eight or so animations that exit from the
news section that have a different gotoAndPlay actions at the end
of them. im just hoping there is some actionscript that i can put
on each button to tell it what to do and where to go.
hope ive explained this ok!
thank you very much and i hope to hear from you.
all the best,
mark

I would create a "movie instance" first of all the
animation(s) itself. Make it as long as you like, but in my demo
I'm using a movie instance (my animation) of about 15 frames. When
someone clicks on a button in my demo here, I use a script that
points to the relavant frame in which I want my animation to play:
Example ( this script attached to button one, the top button of my
nav)
on (release) {
gotoAndPlay("1");
In this code its going right to frame #2 when the first
button is pressed, as seen in the image below of my example, within
the "frame name" layer. I gave the "Frame Label" the name "1". (I
kept it simple)
What that is doing is playing the animation I created (the
word "loading" fading in and out) and placed in the "animation"
layer that runs from frame #2 to frame #14. Then in the "action"
layer, frame 15, I have the "stop" command.
http://www.themekings.com/images/flashsample.jpg
See an eample of the nav unit at:
http://www.themekings.com/themestk/gamers/sectionx/demo.htm
Its not as animated as you want it to be, but it should give
you an idea as what to do.

Similar Messages

  • Newbie is still being stupid! Actionscript for a button to a URL isn't linking??

    Not sure what I am doing wrong now.  I have coded the frame as below, yet when I publish it it doesn't link?  Any suggestions? (obviously a false link here, but am using a link that actually works!)
    stop();
    var getPaypalBoostaboiler:URLRequest = new URLRequest("http://www.addressgoeshere.co.uk");
    //---Get URL---\\
    paypal_boostaboiler.addEventListener(MouseEvent.CLICK,boostaboilerBuy);
    function boostaboilerBuy(event:MouseEvent):void{
    navigateToURL(getPaypalBoostaboiler);

    Just uploaded it and it works fine now - I HAVE SO MUCH TO LEARN!!!
    Thank you so much for your help.

  • ActionScript on Flash buttons

    I am just getting back into using Captivate 2.0 to create
    some online training and I need some assistance using
    JavaScript/ActionScript in Flash buttons. I created a series of
    buttons that are part of a single Flash .swf file. I'm using these
    buttons as kind of a "main menu" and I would like each of the
    individual buttons in the exported Flash .swf file to perform one
    of the following functions:
    - Open another Captivate project in the same (parent) browser
    window, or...
    - Jump to a specific slide in the current project
    I layed out all the buttons in a single .swf file so I
    wouldn't have to import individual buttons into my Captivate
    project. So how do I define the ActionScript for each button in
    Flash to achieve these functions?
    Any help is greatly appreciated.
    Brian

    Hey Brian,
    You can easily open another .HTM file using Javascript, but
    doing so generally won't allow you to do any tracking of results.
    Successful results tracking pretty much requires that an LMS is
    launching each file. That said, opening a new file requires only
    the following line of Javascript, where the path can be either
    relative or absolute:
    window.location.href = "<path to new file>";
    As for jumping to a specific slide in a given file, Adobe
    Community Expert Paul Dewhurst contributed to a discussion topic in
    these forums that references using an undocumented internal
    Captivate array to navigate to a specific slide via Actionscript.
    You can check it out here:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=67&catid=464&threadid =1149498&highlight_key=y&keyword1=variable

  • Nav buttons pixelated in IE-6/7/8?

    Frustration... I got my simple little site where I want it - publish a test to Business Catalyst - it all looks great ... ON A MAC.
    Then a client calls and asks why all the javascript states below top level are pixelated (he means aliased) - and he's looking on IE8.
    Tried to get support to call me back - it's about 40 minutes...still waiting
    I just want to Know if this is a qwerk of the Biz catalyst - or when my client posts it for real.
    In which case I'll have to go somewhere else for Nav buttons!
    Please help with wisdom if you can.

    It would be helpful to have the URL of the page in question, or a screenshot of what's being seen in IE8.
    Muse does not support IE6.  (By most measures IE6 usage is below 1% of site visitors for most sites and IE7 usage is below 2%.)
    Muse does support IE7 and IE8, but both have bugs that are very difficult to workaround that relate to transparent (PNG) images and applied transparency, transparency effects or animated transparency (fade in/out). (Note that for some effects applied in Muse, such as rounded corners, bevel, shadow or glow, Muse 1.x may generate a transparent PNG at output time in order to achieve that effect, so while you haven't explicitly imported a transparent PNG one may still be necessary to achieve your design on the web.)
    Without seeing the problem web page, I'm stabbing in the dark a bit, but the first things I'd look for would be minor changes that might be made to the design to reduce the use of transparency and/or transparent images (esp. overlapping semi-transparent objects or non-100% opacity on anything with a fade in/out effect).
    Another thing I'd try is publishing to a new trial site using Muse 2.0 Beta 2. We've made significant changes to how shadow and glow effects are exported that primarily improve page load performance on newer browsers, but in the process there were changes which may have improved the overlapping transparent PNGs and transparency effects bug workarounds for IE7 and IE8. (If you want to give Muse 2.0 Beta 2 a try, you can update by joining the Muse Beta program via the "Help Improve Adobe Muse" menu item in the "Help" menu. You can then revert back to Muse 1.1 by unchecking the checkbox in the same dialog. Note that you'll want to be sure to save your .muse file from Muse 2.0 Beta 2 to a new file name and not overwrite your Muse 1.x file, so you have your original 1.1 .muse file should you need to revert to Muse 1.1. The release notes for Muse 2.0 are here.)

  • Actionscript Help for Simple Button Events

    Hey everyone,
    I'm pretty new to flash and I think this is a fairly simple animation, but I'm not quite sure how to write out the action script for it. I have a website that has very similiar animations to www.cookstreet.net. I have shapes and text that fly in from the bottom when a button is clicked, but I want to get them to fly back out of the top of the screen when any other button is clicked before any new content loads back in from the bottom. What should I add to the action script to tell flash to first check and see if there is content loaded on the screen when a button is clicked, and if there is, to go to the animation that flies that content out of the top and then return to the animation of the new content coming in from the bottom? What I currently have set up for my buttons is:
    function handleClick( pEvent:MouseEvent):void
        if( pEvent.target == reel )
            gotoAndPlay("Reel");
        else if( pEvent.target == home)
            gotoAndPlay("Home");
        else if( pEvent.target == news)
            gotoAndPlay("News");
        else if( pEvent.target == film)
            gotoAndPlay("Film")
        else if( pEvent.target == about)
            gotoAndPlay("About")
        else if( pEvent.target == contact)
            gotoAndPlay("Contact")
    reel. addEventListener(MouseEvent .CLICK, handleClick );
    home. addEventListener(MouseEvent .CLICK, handleClick );
    news. addEventListener(MouseEvent .CLICK, handleClick );
    film. addEventListener(MouseEvent .CLICK, handleClick );
    about. addEventListener(MouseEvent .CLICK, handleClick );
    contact. addEventListener(MouseEvent .CLICK, handleClick );
    Thanks for the help!
    -Sofi

    What you can probably do is have a variable that you use to keep track of who's present on the stage, starting it off as a null value.  That way when you click a button if the value is null is skips processing a moving out scenario and jumps to the moving in one.  So your event listeners would be calling a different handler function that first takes care of the moving out needs, if any, which in turn calls the moving in function after the moving out activity is done (or the timeline for moving out does... I don't know how you plan to implement the moving out stuff).  If it is a functiob to function process, the moving out function could pass the event.target to the moving in function so that wouldn't have to change at all, except to add in somewhere wha the new variable value should be.
    If what I just offered is one big ball of confusion... take your time and inch your way thru it.

  • Making nav buttons "STOP" ...

    Hi. I have a question about a couple of things with AS3. And,
    I am really excited about my energy towards wrapping up my first
    Flash CS3 site.
    First off, is it possible to make nav buttons stop a Flash
    video from playing (without pressing stop directly from the
    component). I've made numerous attempts, but I have decided to just
    start from scratch. If so, how is it done?
    All the AS3 I have done has most been on the top layers of
    the main timelines. I get a little confused about public and
    private and sprite, but I do know how to paste that content into a
    .AS class file and test it.
    What is a Sprite? Is it difficult to learn and use
    comfortably? Can I use it with the actionscript on the top layer of
    the timeline. I just made a scrolling thumbnail panel. But, now I
    am thinking about turning it into a photo gallery, so I can display
    larger images.
    Jntspecialty

    I see the flvplayback class in the help files, with all the
    methods and properties listed in one spot. I even tested the
    example code and got it to work.
    So, for me, 1st develop the .swf file with the nav buttons
    and be sure to include
    " import fl.video.FLVPlayback;
    trace(FLVPlayback.VERSION);"
    on that page. Right?
    2nd- Then, make a page called "PressToPlayVideoPage.swf" and
    "ThePageWithTheFlvComponent.swf", and on this page drag the flv
    component, set the parameters to a flv named "anything.flv" and
    give it an instance name of "MyVideoWhichWillBeStopped".
    *Basically, the page that is accessed from the nav bar will
    have a button to load the page with the flv component
    /"MyVideoWhichWillBeStopped". Okay?
    3rd - Do what ??? To make the two "nav buttons" (which are in
    a different file) stop the the video from playing, even once
    unloaded or on the bottom stack, from that point on.

  • Is it possible to place forward/back nav buttons in a timeline based gallery. Stand alone SWF needed.

    I'm currently working on a gallery to be output as a stand-alone SWF file, and am doing it all on the timeline as I can't write actionscript for toffee
    So far, I have the gallery created with alpha tweens fading between embedded images. These images are buttons, to which I have added URL links (my only foray into actionscript), which will send the user to a specific link related to the image being shown at the time. At the moment this is just a linear timeline that flows from start to finish and loops to the start again - as per most other simple timeline based animations.
    I have now been asked if I can add two nav buttons (one each side of the frame) to allow the user to flip back and forth through the images. Is this possible on a timeline? And if so, how would it best be implimented? I just don't know if a button action can affect the flow of a timeline.
    Ideally the gallery will auto flow, until either of the forward/back nav buttons are clicked.
    Any help here would be really really appreciated.
    Paul

    Thanks for that Ned. I've had a quick look, and will research deeper later. Though being a complete and utter novice at actionscript, I am flummoxed by probably the simplest of stuff by your standards. For example, the scripts I saw briefly, using the searches you suggested appeared to not export a stand alone SWF file - with no XML files or image folders (I'm still to work out if is possible to do that for this particular use). Also, on all of the examples I saw, the buttons are embedded at the bottom of the pane, and I really need to put the buttons as plainly obvious clickable blobs on either side of the image area. This, again, I can easily do on a timeline (apart from actually making them work of course) but to do this with someone else's AS code, will need more time than I have to learn the relevent stuff.
    Does it sound like I may have to just settle for a linear, non-interactive rotating gallery? - based on my knowledge limitations, as well as needing a stand alone SWF.
    Paul.

  • [Feature Request] Better support for new buttons in JUNavigationBar

    In my project I use a home made sub-class of JUNavigationBar, which contains some new functionality apart from a new button as well. This button allows me to refresh the currently selected row.
    However, since I added this button though a simple this.add(), some of the functionality in JUNavigationBar may get confused.
    For example, when I have removed some of the standard buttons but left my own button in place (setHasXXX()), the component index (calculated in JToolBar) and the array index for the buttons in JUNavigationBar may not match. This occasionally causes an ArrayIndexOutOfBoundsException.
    In short, what I'm asking for, is a better way to manage buttons on JUNavigationBar. Even making the array of buttons and related methods and such protected in stead of private (so that my sub-class could handle it) would be a good start.

    Hi Arno,
    I had a similar issue with trying to create a Nav bar with dynamic content. My solution was to leave all the standard buttons in place and to use setVisible(x) to make them appear or not as required.
    BTW have you noticed that rollover behaviour isn't consistant ie works for FIRST/LAST etc but not for FIND/QUERY.
    Regards
    Andy

  • Problem in embedding a png file for a button's skin

    I am trying to embed a png graphic as a skin for a button using actionscript class for a custom component. It has an error: "unable to resolve 'btn.png' for transcoding" - see method 1 code below. However, it works fine in method 2. Code are all shown belown. Can someone help regarding why this happens and how to make method 1 work?
    Got error in method 1:
    package net.abc.free
        import mx.core.BitmapAsset;
        public class myComp extends Canvas {
            [Embed(source="assets/btn.png")]
            [Bindable]
            public var clasBtn:Class;
        public function myComp() {
            super();  
    Successful in method 2: 
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.core.BitmapAsset;
                [Embed(source="assets/btn.png")]
                [Bindable]
            public var clasBtn:Class;
            ]]>
        </mx:Script>
        <mx:Panel id="mainPanel" width="400" height="300" backgroundAlpha="0">
            <mx:HBox width="100%" height="100%" horizontalAlign="center" horizontalGap="100">
                <mx:Button id="myBtn" upSkin="{clasBtn}"/>           
            </mx:HBox>
        </mx:Panel>
    </mx:Application>

    If you don't put "/" in front of the path Flex will look for the file in the relative path of the file you refer it from.
    Your first example will look for the png file in:
    /net/abc/free/assets/  -- wrong path
    Your second example will look for it in:
    /assets/ -- since the application mxml file is at root level
    but if you put /assets/  it will look for it in /assets/ no matter where the MXML/AS file is

  • Need help with actionscript for media controller

    I seem to be having a slight problem. I've been looking
    around and everything I see is for .flv playback. Anyways, here's
    my problem.
    Client wants a video that's interactive. When a transition
    occurs a simple tex button shows up which links to certain web
    pages. Deploying this as a .swf would be no problem, but they want
    a controlbar with it so a user can scrub back and forth in the
    video. So the best way to do this would be progressive or
    streaming.
    I created a source file that utilizes the "loader component"
    and inserted the "media controller component". I'm not very good
    when it comes to actionscript and can't seem to find the proper
    script which utilizes the media controller so the user can scrub
    back and forth. Everything else seems to work fine with the loader
    as it loads an external .swf file.
    Just need to get the controller working properly. Total
    frames of the swf is a little over 3,000 and dividing the total
    frames by 30 was 107.7 seconds. So I round that to 108 seconds. The
    online docs seem to be fragmented and not always consistant
    especially when i'm not using the flvplayback or display.
    Does anybody know the actionscript for this? Or where I can
    find the information on this? I've associated the loader with the
    controller and vice versa in the behaviors panel as well if that's
    any help. Any help is much appreciated thanks.

    Look, I hope you don't have false expectation that by knowing one piece of AS capabilities you will be able to accomplish your task.
    If I say that the code for placing one MovieClip into another is:
    clip1.addChild(clip2);
    will it make any difference in terms of implementation?
    Also, you say "select." This may mean a lot of thing: click, drag and drop, mouse down, etc. I am saying that implementation tightly depends of definitions that you give.
    I don't know the extend of your AS skills, so it is not easy to figure where to start helping. Also, forum, perhaps, is not the medium where someone will write a lot of code for you. It is good for getting answers to very specific questions and solutions. This is when you have some code in place already.
    What I would suggest is to start developing a very rough concept - no video, no birds, no numbers - just a static background image of the person you have in your first post. If you advance to an application that will allow user to select a square, place the square into another one - it will be a good start.

  • Top Nav buttons not working after publish, but works in app. WHY?

    I have tried to find out why these buttons will not work after publishing. They work fine while in the iWeb app, but not when publishing. I do not have any objects near the top nav buttons. The first site went off without a hitch
    <www.serenitycustompools.net> the second site began the problem with the last page, the nav buttons would not work. Now this 3rd site, none of the nav buttons at top will work after publish, but will work in app. Anyone else having the same probs? None of my pages have the same names or any punctuation marks, and they are simple one word named pages.
    mini intel   Mac OS X (10.4.9)  

    They all work for me, try clearing your browser cache or using another browser.

  • Help with nav buttons please

    Hey there, i've recently been following a tutorial and I have come across a problem with the AS for the nav buttons,  http://www.flash-game-design.com/flash-tutorials/basic-flash-website-tutorial-6.html, the tutorial says to write:
    btnabout.onRelease = function(){
        content.gotoAndStop("about")
    btnport.onRelease = function(){
        content.gotoAndPlay("port")
    btncont.onRelease = function(){
        content.gotoAndStop("contact")
    I have done this and it came with an error saying needs to be in handler, so i re-entered this:
    btnabout.on(release) = function(){
        content.gotoAndStop("about")
    btnport.on(release) = function(){
        content.gotoAndPlay("port")
    btncont.on(release) = function(){
        content.gotoAndStop("contact")
    This code then came back with a Expected a field name after '.' operator.  btnabout.on(release) = function(){ can anyone please help me i'm starting to pull hairs out?!
    Thanks
    P.S it must be AS 2.0 as that is what my portfolio page uses.

    The problem with the first attempt was not the code, but where you placed it.  That code needs to be placed on the timelinein the same frame as where the buttons are  (preferably in a separate 'actions' layer).  This approach is the better approach than trying to place the code on the objects because it keeps all code in a single easy to find location... the timeline.
    For the second attempt, assuming you were still trying to attach the code to the buttons, you should change the code to....
    on(release) {
        content.gotoAndStop("about")
    on(release){
        content.gotoAndPlay("port")
    on(release){
        content.gotoAndStop("contact")
    but.... each of those needs to be attached to the button associated with it and not grouped together.  This is an older style of coding that is best avoided due to ending up with code hiding on objects.

  • Simple nav buttons not displaying correctly

    When I add content to the page that expands the table, the
    nav buttons on the left "spread out". This isn't happening in
    Safari. Any help would be much appreciated. Here is the page I'm
    working on:
    http://www.csayersdesign.com/achieveIT/pages/company.htm

    Curtis Sayers wrote:
    > When I add content to the page that expands the table,
    the nav buttons on the
    > left "spread out". This isn't happening in Safari. Any
    help would be much
    > appreciated. Here is the page I'm working on:
    >
    http://www.csayersdesign.com/achieveIT/pages/company.htm
    >
    >
    Problem is you're doing what a lot of beginners do, trying to
    create a
    page by using one single table and splitting the cells into
    numerous
    cells......that aint going to work as you have found out.
    It doesn't help either that you are allowing Fireworks to
    generate this
    code. When you do that it normally produces fragile code that
    the
    browser tries its best to interpret and a lot of times fails
    The design you're trying to produce is a fairly basic 2
    column table
    which you should ideally set up directly in Dreamweaver.
    A sticking plaster option would be to remove all the elements
    in your
    navigation side bar and merge that column back into one
    single cell. You
    can do that by click-dragging in Dreamweaver then in the
    properties
    inspector where it says 'cell' in the bottom left corner
    click the white
    square icon which will merge all the cells into one.
    The downside to this is that it may upset the fragile code
    created by
    Fireworks and throw your page into even more turmoil.
    If it does work you then need to insert another table (a
    nested table)
    into the cell which you merged back into one. Then put your
    navigation
    buttons into it.
    Tables that are independent of one another cannot interact
    and so you
    create a more stable environment for your design.

  • Having nav buttons outside print area in adobe reader

    I am building a parts manual and want my nav buttons off to the side of the 8.5"x11" document in sidebars. Easy to accomplish in Indesign but when exported to pdf , the print feature in Adobe reader prints the total width of the document. I want the customer when select print to just print the center frame (no nav buttons)and not have to set up crops etc for printing. Ive seen parts manuals like this and am having a hard time accomplishing this myself. Any help would be appreciated.
    Here is link to an example of this pdf
    http://www.mediafire.com/?h62z5y341wyky66
    Thank you in advance

    Just set their visibility to "Visible, but doesn't print".

  • Weird iWeb problem with nav buttons....

    Hi all. New to this and a complete idiot. The club which I am the Prez of needed a web site, and as no one else volunteered, I ended up doing it. Everything seemed to go fine for a while until I started modifying the original site....then I started getting weird things happening. Many of them I have figured out but the last one is beyond me. The problem is with the text in the nav buttons at the top of the pages. On the first page all the navigational buttons are fine, but on all the other pages the button that takes you back to the home page has text I never put in, and it does not appear in it's entirety. Can anyone provide any help as to how I can fix this. The URL is:
    www.nocasa-ft.com

    Indeed, the problem is with the cache. I cleared the cache and all now comes up as it is supposed to. Thanks so much for your suggestion. I was rather disappointed because it seemed the problem was with Safari, and I kind of like that browser. I didn't want to have to use something else.
    Thanks again.

Maybe you are looking for

  • Reset dunning level

    Hi, is it possible to reset the dunning levels of the bp? My customer tried the dunning wizard once but now want to reset the dunning levels because the customers 've neve got the dunning letters. Is this possible and how? Best regards Philipp

  • Automatic event creater in iCal

    I work at a school that has a seven day cycle: A through G days. I am trying to create a workflow that will automatically create events (my classes) for each day in my cycle. For example, this Thursday will be an A Day, and I will have one class from

  • Automatic updation of planned delivery time in material master.

    Dear all, Is it possible to update the Planned delivery time in the material master automatically by the system based on goods receipt date. what customisation needs to be done. Regards, Dayanand

  • Changing file clicking default behaviour for all users

    Is there a way to change the default file clicking behaviour for all users? Each user can do it himself by going via the username menu ("Personal Preferences", "When clicking on a file...") but I would prefer to set it for all users to a value that i

  • Setup Assistant Freezes after installation.. cannot complete setup

    Hi - I recently installed an Apple DVD RAM drive in my 450Mhz B&W G3. As far as I know it meets the system requirements - it has 640MB RAM and built in firewire. Anyway, I was upgrading from OS 10.2.8 and I kept getting an error. So I ran the disk ut