Where do I put my Action Script?

So, I created a small Flash site with no loading of external
swfs. I am strictly using the timeline using labels. I have a layer
for my main buttons (home, portfolio and timeline). I have selected
AS3 for the file and I have those buttons working fine.
I have a button for my portfolio where thumbnails will pop up
after being pressed. I want to link those thumbnails to the URL's
of the actual websites. Where do I put the action script?
I also want to have my email at the bottom of the screen so
you can click on it to email me. I am used to using AS2 whwere you
simply put the code on the button.
Thanks,
Gabe

Hey, so thank you for the fast reponse. I totally agree with
you on learning AS3, I don't want to go back to AS2.
I already have the code you supplied so I understand what it
is doing but my question is where do I put it in this case? I
always create an action layer as you mention. In my action layer, I
have frame 1 with my preloader code and then frame 2 with my code
for my main buttons. They call to the labels. So, when I press
portfolio for example, it goes to that label.......a shape tween
starts and my portfolio thumbs appear. I then want those thumbs to
link to the URL of those sites.
So, where do I stick your code?
Thanks again for all your help. I am NEW to AS3 and this is
great learning.
Thanks,
Gabe

Similar Messages

  • [SOLVED] Where should I put this sound script?

    I found a sound script so that when my tv outputs hdmi sound also does so automatically. Where do I put?
    #!/bin/sh
    if [[ $1 ]]
    then
    xrandr --output HDMI1 --off
    pactl set-card-profile 0 output:analog-stereo
    else
    xrandr --output HDMI1 --mode 1920x1080 --right-of LVDS1
    pactl set-card-profile 0 output:hdmi-stereo
    Last edited by quasifilmie (2012-01-30 00:56:33)

    Yeah, I was afraid of that. 
    How do you start your window manager, and which window manager / desktop environment are you using?
    If you are using startx, you could invoke it from your ~/.xinitrc.  You might create a second scipt, launch it in the background, and put a sleep at the beginning to ensure X is ready.
    KDE, Openbox and Xfce4 allow you to run scripts at start up.  Gnome might, I would not know.

  • Where do I put my actions?

    Since changing over to AS3 I'm totally confused over the placement of Actions on the timeline?
    My confusion is with the placement of the Event Listener and Function for each button.
    It appears to me that the button must be on the stage BEFORE the actions are defined, does this mean that the actions must always be defined in a frame after the button is first seen?
    This seems to be pretty messy and not as sensible as previous versions where event listeners etc where just palced in frame No.1  and I have no idea how this could work with dynamic run-time buttons.
    Or.... am I missing something very obvious (which is much more likely)??
    Regards
    Dave

    Ok, try this ...
    Button layer ..............................X__________________________stop
    Option 1....................................Y_____________stop
    Option 2................................................................Z___________stop
    X is the frame containing the button and its actions
    Y is the start of option one
    Z is the start of options two
    If the program jumps to Y it sees the actions but if it jumps to Z it does not see them but it does see the button
    Does that make any sense?
    Regards
    Dave

  • Help with adding action script to an order form

    Hi - Firs time I'm on this board. Searched and didn't see
    anything that fit. Adobe/Macromedia Support told me my form needs
    an action script insert for me to gain access to a previous page.
    I'm revamping an online order form. It's about 2 1/2 pages in
    length. I find that I can't go back to the first page -- I'm locked
    in the second one. On split screen the HTML coding shows there is
    more than one page. Also, when I look at it in a browser the whole
    page is there.
    Does anyone know how and where I can put in action script.
    I'm not an HTML maven so this isn't my thing. Thanks for whatever
    advice you can give.
    Best - ETide

    Visit gotoandlearn.com and find a tutorial there for creating
    a preloader.

  • FLASH MX 2004 action script question

    Hi!
    I need to create an script for a basic function; when mouse goes over a moveclip, that works also link, I want it to trigger an invisible red dot on a nerby map. I have created a movieclip and named it "red", it's a 1 sec clip with nothing in the beginning and a red dot in the end. I want this dot to trigger and show only when mouse goes over this specific link, otherwise it must be invisible.
    I know this is pretty basic stuff and I have done this before few years back but I have forgotten how to do it and need help now.
    Any help would be very much appreciated :-)
    Kim

    I still need help, this problem is little more complicated;
    I can manage making the red dot visible and invisible by triggering roll over and roll out on a button.
    The problem is, I have a navbar which is line of flags made to a movie clip, with 5 invisible buttons. These buttons are configured to do three different actions; get URL, trigger a light effect and a movement effect.
    Now I need this invisible button to trigger my red dot also so that when mouse is over a certain flag a red dot appears on a map on the correct location.
    I have the red dot on a new layer. It has instance name "redDot" and on the very first frame of this red button layer, I have action script that says: redDot._visible = false;
    This works as it should and the dot is invisible when the movie has loaded.
    I need to make this invisible button to trigger the visibility of my red dot, and I have tried to add the code:
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    to this invisible button, but it dosent work, furthermore it affects the other functions of the button/movie clip, which were working fine before.
    Here is the code attached to this invisible button so far:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    I have the URL:s on an external text file.
    So my question is; where do I add the action script to make it visible when moving the mouse over this invisible button? To my understanding, it should go in the same place as the other code that is working, but I'm doing something wrong...
    I tried to do this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2)
            redDot._visible = true;
    on (rollOut) {
    gotoAndPlay("sec")
    redDot._visible = false;
    But it is wrong, I also tried like this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    But it makes the other functions that worked to stop working.
    I also tried to give the invisible button an instance name and do it like this:
    invisible.on (rollOver) {
            redDot._visible = true;
    invisible.on (rollOut) {
    redDot._visible = false;
    And put them in the actions layer of button movie clip but nothing works.
    Flash is really giving me a headache now...
    To conclude, I made a simple test button, put it on the scene somewhere and and attached the rollOver and rollOut codes, targeting the "redDot" and it works fine, the button didn't need a instance name to work. I don't understand why I can't make it to work with the invisible button where it should be.
    I hope this clarifies the point and I can get some help with this and sorry for bothering again with this problem.
    Oh and I use old Flash MX 2004.
    Thanks
    Kim

  • Problem with action script to button

    Hello all.
    I'm having a problem with my adobe flash CS3 action script. My button cant link to the other URL. I tried to put an action script but i fail. anyone can help me? here the attachment for my flash document.

    HELLO,
                  just check       navigateToURL()

  • Can FC put action script in a 'code behind'.

    Once of the practices I do in FB3 is to move all my action script into 'code behind' files instead of having all the code in the mxml files.  Does FC have the option to do that (as part of the gen process) and if not, does anyone else who 'codes' instead of 'designs' feel that is a benefit?  I know I'd prefer it to be in a 'separate' as3 file.  Also, if I DO move the code into code behinds (I've not tried it yet), does FC have any issues reading the code behind?  I'll be trying that on a 'simple' project to be sure but figured I'd ask just in case anyone else wants to know...

    The two references cited helped answer questions about Adobe's overall philosophy and approach that came up as I worked a simple example down the design/development stack of tools from Illustrator (AI) to Catalyst (FC) to Flash Builder 4 (FB).
    Other questions that arose were:
    Each application (AI, FC, FB) contains tools for design with some degree of overlap.
    Will FC eventually include from AI (or Photoshop, InDesign, etc.) and the FB design view all functionality needed for interactive storyboarding and skin generation?
    Is it the intent for FC to become the designer's tool and FB the developer's tool, at least for application design?
    The diagram in the Gumbo skinning spec shows that base components and their subclasses are typically implemented in AS and skins in MXML and recommends this as the preferred design pattern. Yet when I converted one of my groups (essentially a form) to a customized component, and exported the project into FB, I noticed that FC had generated a single mxml file (CustomComponent1 ...) and not a pair of files (an X.as file for the base component and an X.mxml file for the skins).
    For several reasons, wouldn't you want to generate separate files as depicted in the Gumbo diagram as a starting point for code customization?
    How does one develop custom components in FB (or using AI+FC+FB) and package them as a library so that they can be dropped into FC and used in the way that the current set of 5 components (button, hscrollbar, vscrollbar, text input and data list) are used?
    How will I integrate my hand-coded dynamic components for data visualization alongside more generic and static app components on an RIA page?
    How would I use AI+FC to design liquid layouts where children at each level often utilize constraints (i.e. top, bottom, left, right) between parent and child?
    For agile methodologies, how will refactoring the interaction or software design work in this new world where interaction designers are trying to maintain full control over appearance and interactive behavior?
    Finally, I would like to know what tools and steps Ely used to develop the component shown in the video. It would be instructive to turn that into a tutorial that we could walk through, step by step, in slow motion
    While I understand the arguments for separation of design and development as a workflow methodology, those of us with development and HCI/visualization backgrounds building research prototypes would like to see integration of the design and development tools (from the perspective of the workflow, not the architecture and code).
    As Jordan said, the direction you are heading is inspiring. Keep up the good work.

  • Where do I find anm experienced Action Scripted fast?

    Hi,
    I have a Flash presentation which needs completed. Basically,
    all of the buttons need programmed and as a newbie who is running
    out of time to learn, I need some help.
    First, I'd like to know where you find people who can do this
    (here?)
    Secondly, how long it would take to programme approx 875
    buttons (many of which are repetitions (e.g home button, help
    button, exit button appearing on every screen). There are
    approximately 109 screens which need to be linked.
    Thirdly, what would be a realistic price to expect to pay for
    someone to do this? It is a non-profitmaking project for a
    voluntary organisation.
    Thanks

    nicknamesaretaken,
    > I think I see what the problem is, but still struggling
    to
    > get it to work.
    Okay.
    > I now have:
    >
    > stop(); {
    > on (release)
    > this.gotoAndPlay("CS1"); // this is the correct code.
    > }
    Okay, the on() event handler may not belong here. The on()
    and
    onClipEvent() functions are an older (Flash 5 era) way to
    handle events in
    ActionScript. They're still available in Flash 8, and they
    work just fine,
    even in AS2, but these are applied *directly to* the object
    in question; as
    in, you click your button to select it, then type into the
    Actions panel
    while the button is selected. In such a case, no instance
    name is needed
    for the button (or whatever object). The above code would
    have to be
    attached to each button -- which really gets old with a large
    number of
    buttons -- and the stop(); action would have ben appear
    inside the on()
    function.
    Your earlier approach -- where you referenced the button's
    instance name
    and assign a function to the Button.onRelease event -- is the
    recommended
    best practice, and has been available since Flash MX (aka
    Flash 6). There's
    nothing about your earlier code that shouldn't have worked --
    it's just you
    *might* have been experiencing the Scenes-related bug I
    mentioned.
    I would change your previous code as follows:
    // in a frame script ...
    stop();
    skipintro_btn.onRelease = function() {
    this._parent.gotoAndStop("frame label here");
    That stops the timeline in which this ActionScript appears.
    Then it
    assigns a function literal to the Button.onRelease event of
    the button
    symbol whose instance name is skipintro_btn (if that object
    is actually a
    movie clip, then it assigns a function literal to the
    MovieClip.onRelease
    event of that instance -- funtionally the same thing). Then
    it refers to
    the parent of this object, which is the timeline in which the
    object
    appears, and tells that timeline to gotoAndStop() at the
    named frame label
    you provide -- even if that frame label is in another scene.
    Make sense?
    > Are there any good Action Script books you could
    > recommend?
    There are quite a few good ones on the market lately, but
    the last I can
    think of that I enjoyed -- from a general programming
    standpoint -- is
    Object-Oriented ActionScript For Flash 8 (Friends of ED), by
    Peter Elst and
    Todd Yard.
    > I'm also a bit worried about bug comment. Does it mean
    > that I will have difficulty playing this project in
    Flash Player
    > 9 as it's not written in Action Script 3.0?
    You shouldn't have any problems. As long as you use the
    frame labels
    approach and avoid Scene names, Flash Player 9 will run it
    the same as older
    Players. Flash Player 9 is the first to feature *two* virtual
    machines for
    ActionScript. One is the overhauled AS3-lovin' machine; the
    other maintains
    backward compatability for AS1 and AS2.
    > If so, that's a big problem isn't it as people will need
    to
    > download older versions of Flash Player to view it - or
    > I'll need to include older version on the disc.
    Right, but you don't have to worry about that. :) The Scenes
    issue is
    an old one, and it is a big problem, but at least the
    workaround is easy
    (frame labels).
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Where is the action script?

    I'm new to Flash. I've an animated movie clip that I wanna
    duplicate. The movieclip is clickable and when it is clicked, the
    Movie goes to a specific frame. I wanna duplicate it but change the
    frame number to a new one. The problem is I can't find the action
    script code associated with this movie clip :( right click then
    actions gives nothing, I tried to edit it but I can see no actions
    as well :( Is there anyway to get the actionscript associated with
    a movie clip?
    Thank you

    if its AS3, actions are no longer applied directly to the
    movie clip. They will most likely exist in the first frame of the
    time line (click the frame, then open the actions window) or as an
    external .as file. (less likely for a simple movie)
    Try to find a frame on your timeline with a small 'a' in it
    and use the actions window to look at it and make whatever changes
    you need.

  • Flash Newbie needs help with Movie Clips/Action Scripting

    Hi -
    I'm having a problem with my movie clips playing
    simultaneously and cannot, for the life of me, figure out what I
    have done wrong. I'm new to flash, so I may have set something up
    incorrectly, but here's what I have so far:
    11 layers, total: 1 layer with 10 control buttons, each
    button with the following actionscript:
    on (release) {
    gotoAndPlay(85);
    Where the number changes in relation to which keyframe the
    next movie is on.
    I have 10 movies, total, but they are only movie clips,
    essentially photo slide shows with audio, made all in the library.
    The problem happens when I click on the second or third
    button. Not only does the movie that I have selected begin to play,
    but all of the previous clips do as well, so it all sounds quite
    garbled. I don't know what I am missing in the action script, as my
    Action Layer has a stop command on it at each keyframe where there
    is a new clip to play.
    I have tried to add a stopAllSounds command, but I'm afraid
    that doesn't do anything because it is not a "sound file" per se,
    playing in the timeline.
    I'm at the end of my rope and really need some help in
    figuring this one out. My project is hanging in the balance on
    this, as I have scripted everything else correctly and it runs
    beautifully.
    Please help!
    Thanks,
    Caroline

    Each layer has a blank keyframe before and after each
    movieclip. Each movie clip is at a different frame. Even with the
    blank keyframes added, the second video starts to play and then the
    first video begins to play. Same happens if I click on the third
    button. Third plays, and starts 1st and 2nd shortly thereafter. Is
    there an action script I can put in that will tell the timeline
    that, when a button is clicked, no matter where the movieclip is,
    it will stop and start the newly selected movieclip?

  • Newbie here, with button action script issue

    I have just started to scrach the surface with actionscript
    and I have attempted to assign it to buttons. Much to my supprise,
    it worked, sort of... All my buttons require a double click the
    first time you click on them. I was able to put
    this together, by
    using the following action script for all my buttons:
    on (release) {
    ybutton.onRelease = function() {
    gotoAndStop(28);
    So I have 2 questions. What actionscript will give me the
    single click that I am looking for? Also, is there any shortcut to
    making a broad change? In other words, will have to switch out the
    code for every button on 37 frames?
    Thank you

    1: // You needed two clicks because you have 2 onRelease.
    on (release) {
    gotoAndStop(28);
    2: Yes, it'll go fast I would copy the above and paste where
    needed then just change the frame #.

  • How can I extract cursor coordinate in Adobe Photoshop for use in Action script?

    What I want to do in Photoshop (version CC, but I think this applies to any version) is label a point using count tool under my mouse's current position, and label it multiple times (for different labels). I have an action that essentially does this:
    (1) Add to count (under one label) (2) Switch to second label (3) Add to count (under second label) (4) Switch to third label (5) Add to count (under third label)
    And the problem is that I need to be able to have a variable in the action script that uses the cursor's current position (X and Y numbers) on the canvas to set these three points when the macro is activated. Currently I am only able to record the script using constant X, Y values (the same point is labeled over and over when I play the recorded action). I am able to extract the code for the action for editing (via xbytor2's suggestion in this forum:https://forums.adobe.com/thread/696989) and I see where the variable can go, I just don't know what exactly to put in place of the constant X, Y values that will let Photoshop input the mouse's current coordinates...
    Any ideas? Much appreciated!!

    You could use the pen tool set to path and create a single dot, then run the script to get the cursor positions and use that in your script.
    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    var doc = activeDocument;
    var workPath = doc.pathItems.getByName("Work Path");
    var pos = workPath.subPathItems[0].pathPoints[0].leftDirection;
    $.writeln("x = " + pos[0] + " y = " + pos[1]);
    doc.pathItems.getByName("Work Path").remove();
    app.preferences.rulerUnits = strtRulerUnits;
    app.preferences.typeUnits = strtTypeUnits;

  • Help with action script please

    hay guys, im having trouble with changing my action script to
    allow multiple layers of the same thing in order to show a greater
    sense of depth than the normal application. im using a flash
    toutorial on making a sort of matrix like falling text (
    link)
    and im not completely understanding what to change in order to
    accomplish my goal. i tryed to send them a message using their
    contact page, but its broken, forcing me to find a forum. im sure
    it has something to do with the third group of code where it
    identifies what its using. but whenever i change anything there to
    either match the identifiers or movie clip names the action script
    crashes when i test the movie. any help is appreciated.
    im using flash cs3 and made sure to create it all in action
    script 2.0
    please excuse my spelling, im sure i made a mistake
    somewhere.

    "FlashTastic" <[email protected]> wrote in
    message news:e4ir4t$ru4$[email protected]..
    >I don't think an enterframe will be your best bet.
    >
    > You might want to use something like
    >
    > if(_root._currentframe >= _root.totalframes){
    > loadMovie("myMovie.swf",_root)
    Why in the world would you do that when you can just put a
    keyframe on the last frame and ..
    loadMovie("myMovie.swf");
    tralfaz

  • Another aborted Action Script

    I'm making a slideshow about 18 images in all 9 thumbnails and 9 full size images. The problem I keep running into is the "a script in this movie is causing flash player 9 to run slowly" error. The Flash is set to player 9 and action script 2.0. I have followed the uninstall reinstall tips in other threads and even tried it on another machines, ultimately coming up with the same results. I have read that there could possibly be too much script on the single frame so that said here is the script that is all on that first and only frame.
    this.createEmptyMovieClip("container",1);
    var imagesNumber:Number = 9;
    for (i=1; i<=imagenumber; i++) {
    container.attachMovie ("Cakethumb0"+i, "Cakethumb0"+i+"_mc",i);
    Cakethumb_mc = container ["Cakethumb0"+i+"_mc"];
    Cakethumb_mc._x =(i-1) *Cakethumb_mc._width;
    Cakethumb_mc._y = (Stage.height-Cakethumb_mc.height)/2
    Cakethumb_mc.largerImage = i;
    Cakethumb_mc.onRelease = function() {
    _root.attachMovie ("Cakeimage0"+this.largerImage,"large_mc",2);
    large_mc._x = (Stage.width - large_mc._width)/2;
    large_mc._y = (Stage.height - large_mc. _height)/2;
    large_mc.onRelease = function() {
    this.removeMovieClip();
    container.onEnterFrame = function () {
    this._x += Math.cos((-root._xmouse/Stage.width)*Math.PI)*15;
    if (this._x>0) {
    this._x = 0;
    if (-this._x>(this._width-Stage.width)) {
    this._x = -(this._width-Stage.width);
    I appreciate any help you guys can send my way.

    Is the following a coding error where you declare a variable but misspell it when it gets put to use, or is the variable used somewhere else?
    var imagesNumber:Number = 9;
    for (i=1; i<=imagenumber; i++) {

  • Problem with action script from Schewe and Frasier book.

    I am working on a Photoshop CS3 action script to
    open raw files, do a couple of modifications
    in Camera Raw, exit camera raw and save
    the file as a jpeg.
    I think this should work, because I am working
    on an example out of "Camera raw with Adobe
    Photoshop CS3" by Schewe and Frasier which
    shows the step recorded.
    See page 344 of Schewe and Frasier.
    In figure 9-11 you see, after the open
    statement, 10 lines of details like
    "As camera raw"
    "Model:Canon 350d" etc.
    I get the file path and name line, but
    none of the other details reflecting
    actions in Camera Raw.
    The problem is that in setting up the action, none
    of the steps done in camera raw after I do the
    open get recorded.
    And it works in my old CS version !
    Out of frustration I repeated the action
    script creation in my old CS version and
    it worked fine.
    Any idea where I am screwing up ?

    Crappy format justification:
    I sometimes have a day of family
    type pictures that are in raw format
    that I want to put up on the internet
    quickly. I would like to be able to
    apply the "Auto" feature, as in general
    it seems to be pretty good for something
    quick.
    OK, it sorta works in CS, go here
    http://www.angelplace.net/photos/sample.jpg
    It sets up all of the details and gets the
    "As camera raw" but opens the .dng file
    rather than the Camera raw window.
    The point is, these important settings
    seem to be saved, which does not happen
    in CS3.

Maybe you are looking for

  • Creation of Excise Invoice J1iin without goods movement (against PV Bills)

    Dear Expert, Could you please explain how to create an Excise Invoice j1iin,  in one scenario where goods movement does not take place. I am creating a sales order with a service material called price variation and billing it through VF01. Now on the

  • DBMS_LOB.WRITEAPPEND - HELP!

    Why is my code failing? All I am doing is reading text from an external file (UTL_FILE package) and appending it onto an NCLOB variable, but the WRITEAPPEND to the NCLOB variable is failiing. I know the WRITEAPPEND is failinb because I instrumented t

  • Firefox won't display Courier

    Firefox 14 simply won't display Courier on my system. Every instance of Courier is replaced by Courier New, and it makes my website look improper (I want the aliased look of the original Courier font). Why won't Firefox 14 use Courier?

  • A & b works also for int primitives ?

    Hello During my lessons java SCJP 5.0 I saw that the & expression also excepts integers as oprands. But how can i predict the outcome of such an expression. For example int a=1,b =1; a++; System.out.println(a & b); // Prints 0 a++; b++; System.out.pr

  • 3.5update 1a on solaris 10 v40z

    Currently, I have SunMC 3.5 installed on my server and console, running on solaris 9. I installed 3.5 update 1a straight on a v40z server running solaris 10. i also make sure i seeded the correct secret key and customize the domain-config.x on the ag