Actionscript 3 to go to a later frame?

I am using this code:
myButton.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
gotoAndStop("Scene2", 1);
To make a button go to another scene.
How can I modify the code to make it go to the same scene,
just a later
frame?
Thanks.

Everything worked when I had just a simple button that
onClick sent the
user to frame 30. I then added another button on frame 30 to
send the
user back to frame 1, and now when I test the movie it just
goes to the
next frame and right back to the first frame onclick. What is
wrong with
the code I am using?
I have 3 layers:
Button Actions
Frame Actions
Button
On Frame 1:
Button Actions =
Btn1.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
gotoAndStop(30);
Frame Actions =
stop();
On Frame 30:
Button Actions =
button2.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
gotoAndStop(1);
Frame Actions=
stop();
I also get this error:
1021: Duplicate function definition.

Similar Messages

  • Button that links to later frame and also stops music from playing   in background

    I have some audio playing that I want to stop when a user
    clicks on a
    button that links to a later frame.
    Does this look correct?
    SoundMixer.stopAll();
    Btn1.addEventListener(MouseEvent.CLICK, buttonClick1);
    function buttonClick1(event:MouseEvent):void{
    gotoAndStop(30);

    I'm sorry, I'm not sure what you mean by this. Could you
    please show me
    the syntax?
    Thanks!!!!!!
    kglad wrote:
    > no.
    >
    > your stopAll() method should be applied within
    buttonClick1 if you want that click to stop the sound(s).

  • Goto frame of child movieclip on later frame

    Hi, I've been trying to find a tutorial or description on how to do this.  Sorry if I'm asking something repetitive but I can't seem to find the right way to search for it or find something that explains it.
    What I'm trying to do is click btn1 on mc1 timeline frame 1 that will goto and play mc1 timeline frame 30 where the child mc2 is, then play mc2 at frame 10.
    I know this won't work as mc2 doesn't exist til frame 30 but to give an idea
    btn1.addEventListener(MouseEvent.MOUSE_UP, release1);
    function release1(evt:MouseEvent):void {
    this.gotoAndPlay(30).mc2(10);
    kind of like how you can go to a frame label in a scene
    mc1.gotoAndPlay("intro", "Scene 12");
    From what I've gathered so far it's using integers?
    Thanks for any help.

    Thanks again... I've learnt from both of you, although I did go with the RENDER as it kept the code in one place and it was the first reply lol
    I used this and it works fine:
    btn1.addEventListener(MouseEvent.MOUSE_UP, release1);
    btn2.addEventListener(MouseEvent.MOUSE_UP, release2);
    btn3.addEventListener(MouseEvent.MOUSE_UP, release3);
    function release1(evt:MouseEvent):void {
    this.addEventListener(Event.RENDER,renderF);
    stage.invalidate();
    this.gotoAndStop(30);
    function renderF(e:Event):void{
    this.removeEventListener(Event.RENDER,renderF);
    services_mc.gotoAndPlay(1);
    function release2(evt:MouseEvent):void {
    this.addEventListener(Event.RENDER,renderG);
    stage.invalidate();
    this.gotoAndStop(30);
    function renderG(e:Event):void{
    this.removeEventListener(Event.RENDER,renderG);
    services_mc.gotoAndPlay(16);
    function release3(evt:MouseEvent):void {
    this.addEventListener(Event.RENDER,renderH);
    stage.invalidate();
    this.gotoAndStop(30);
    function renderH(e:Event):void{
    this.removeEventListener(Event.RENDER,renderH);
    services_mc.gotoAndPlay(31);

  • Export for actionscript - Not in first frame

    Just a simple question.
    Don't need to know if it works or not I have tested it. What
    I want is to understand. Here it is:
    If I use the Export for actionscript and I unselect the
    Export in first frame, the item that will be linked by the ID in
    the library must appear on the timeline. Normally it must be on a
    frame that has played. IE frame 3 the item is there so I can use it
    from the frame 3 to the last frame. This is how it works for the
    _root. If I'm in a clip, the code can be on the first frame with a
    stop. That means that the Item is on the second frame and has not
    displayed, but it is accessible by the code.
    Why?
    Why on the root the item must appear on the frame where the
    code is or before the code, but if in a clip, the code can works
    even the item reside on a later frame that will never display
    because there is a stop on the first one?
    Tanx for your help to understand!

    I think that this is probably because of how flash streams
    content. In order for flash to play frame 2 on the timeline, it
    COMPLETELY loads all the code and assets for that frame (but not
    frame 3) and then 'plays' that frame. Therefore on the main
    timeline, code on frame 2 can't access exported clips from frame 3.
    However, if your movie clip is (for example) on frame 4,
    flash will stream/load everything (including your complete move
    clip) when the play head reaches that frame, so all assets within
    that frame are available because in order to even 'play' frame 4,
    flash has had to load the entire movie clip contents.

  • 3 same buttons & 3 different frames, but each frame must have it's own actionscript?

    Here is my issue. I have 3 frames and 3 buttons. Each button takes you to their respected frame. However, I noticed that I cannot have 1 key frame of actionsript read the same on those 3 frames. Why? because if I jump from frame 1 to frame 2 or 3, then I cannot jump back. Instead, each frame has to have it's own actionscript. The only thing that would change is the method name. I find it tedious. Is that how  it is? This almost felt seem like it would be less tedious but even for 3 frames, I have to change each method name as I build more frames to navigate to. Check my example below:
    Old Actionscript (1 keyframe for 3 frames did not work to jump back any frame)
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame1);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame2);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame3);
    function handlerFrame1(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame2(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame3(event:MouseEvent):void {
    gotoAndStop("frame3");
    New Actionscript (3 keyframes and this works):
    Frame 1
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame1);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame2);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame3);
    function handlerFrame1(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame2(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame3(event:MouseEvent):void {
    gotoAndStop("frame3");
    Frame 2
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame4);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame5);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame6);
    function handlerFrame4(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame5(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame6(event:MouseEvent):void {
    gotoAndStop("frame3");
    Frame 3
    frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame7);
    frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame8);
    frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame9);
    function handlerFrame7(event:MouseEvent):void {
    gotoAndStop("frame1");
    function handlerFrame8(event:MouseEvent):void {
    gotoAndStop("frame2");
    function handlerFrame9(event:MouseEvent):void {
    gotoAndStop("frame3");

    You should not need to have code in all three frames.  The first bit of code you show should suffice under normal circumstances.  If you have the code on a layer that has only one keyframe and the buttons on a layer that only has one keyframe, then the buttons will remain working.  It is only when you create new instances (keyframes) of the buttons that you need to assign new event listeners for them, but even then the same event handler functions can be shared for all of them as long as that actions layer extends the length needed for all the buttons.

  • AddChild + "export in first frame" unchecked

    Hi all,
    i've got this problem that i can't figured out. i've tried
    google and adobe website, but no luck. i guess the people here
    could help me
    this is about addchild and export in first frame. i wanna
    call an object from my library. in its linkage option i:
    1. name it "rectangle"
    2. give a class name "Rect"
    3. have a base class "flash.display.MovieClip"
    4. check "export for Actionscript"
    5. unchecked "import in first frame"
    no problem this far.
    but when i tried to call it in main timeline with this
    script:
    var a:Rect = new Rect();
    addChild(a);
    i got this error:
    1046: Type was not found or was not a compile-time constant:
    Rect.
    1180: Call to a possibly undefined method Rect.
    why is that?
    isn't flash automatically generate the class for me?
    (a definition of this class could not be found in the
    classpath, so one will be automatically generated in the SWF file
    upon export.)
    can anyone help with my problem...

    because you haven't done anything to export your class.
    if you're not going to let flash take care of exporting your
    class in the first frame, you have to do something to export it
    later. and you're not and flash won't do that automatically
    becauese it doesn't know what you want to do.

  • Preloader ignores external swf's actionscript

    Hey guys
    I have an External.swf file that is a video. The swf is 1135 frames long and running just fine by itself, stopping as I want when the actionscript says stop(); on the first frame and looping the end of the clip with gotoAndPlay(837).
    The preloader SwfLoader.swf linked to the External.swf shows the percentage of bytes loaded as it should. However, it runs the video (sound playing in the background) while the preloader shows the loading progress I think it's because it doesn't load the first frame first.
    Once the external swf is loaded, it plays the video again, still ignoring the first actionscript frame that says stop(); and the last frame gotoAndPlay(837).
    Thank you.
    Here is the preloader's actionscript on the first and only frame:
    import flash.geom.*
    import flash.display.*
    var loadurl:String = "External.swf";
    var nDepth:Number = 0;
    var nWidth:Number = 200;
    var nHeight:Number = 20;
    var nPadding:Number = 3;
    var cLoader:MovieClipLoader = new MovieClipLoader();
    var oListener:Object = {onLoadInit:onContentLoaded};
    var mcLoader:MovieClip = this.createEmptyMovieClip("Loader_MC", 0);
    var mcContent:MovieClip = this.createEmptyMovieClip("Content_MC", 1);
    var mcLoadBarBg:MovieClip = mcLoader.createEmptyMovieClip("LoadBarBg_MC", nDepth++);
    var mcLoadBar:MovieClip = null; //Duplicated later with mcLoadBarBg
    var txtPercLoad:TextField = null; //Create after duplication
    var cMatrix:Matrix = new Matrix();
    mcLoader._alpha = 0;
    cMatrix.createGradientBox(nWidth, nHeight, 0, nPadding, nPadding);
    cLoader.addListener(oListener);
    mcLoader.lineStyle(1, 0x000066, 100);
    DrawRect(mcLoader, 0, 0, nWidth, nHeight);
    mcLoadBarBg.lineStyle(1, 0x0000FF, 0);
    mcLoadBarBg.beginGradientFill("linear", [0x006699, 0x0066FF], [100,100], [0, 255], cMatrix, SpreadMethod.PAD);
    DrawRect(mcLoadBarBg, 0, 0, nWidth - nPadding*2, nHeight - nPadding*2);
    mcLoadBarBg.endFill();
    mcLoadBar = mcLoadBarBg.duplicateMovieClip("LoadBar_MC", nDepth++);
    txtPercLoad = mcLoader.createTextField("PercLoad_TXT", nDepth++, 0, 0, nWidth, nHeight);
    mcLoadBar._alpha = 80;
    mcLoadBarBg._alpha = 30;
    Translate(mcTextMask, nPadding, nPadding);
    Translate(mcLoadBarBg, nPadding, nPadding);
    Translate(mcLoadBar, nPadding, nPadding);
    mcLoadBar._xscale = 0;
    mcContent._alpha = 0;
    mcContent._lockroot = true;
    mcLoader._x = Stage.width/2 - mcLoader._width/2;
    mcLoader._y = Stage.height/2 - mcLoader._height/2;
    txtPercLoad._x = mcLoader._width/2 - txtPercLoad._width/2;
    txtPercLoad._y = mcLoader._height/2 - txtPercLoad._height/2;
    SetTextFormat(txtPercLoad, "0%");
    mcLoader._alpha = 100;
    cLoader.loadClip(loadurl, mcContent);
    _root.onEnterFrame = function()
       var nBytesLoaded:Number = mcContent.getBytesLoaded();
       var nBytesTotal:Number = mcContent.getBytesTotal();
       var nPercLoaded:Number = Math.round(nBytesLoaded / nBytesTotal * 100);
       if(nPercLoaded > 0)
          SetTextFormat(txtPercLoad, nPercLoaded.toString() + "%");
                mcLoadBar._xscale = nPercLoaded;
    function onContentLoaded(Void):Void
       //trace(_root + "::onContentLoaded");
       SetTextFormat(txtPercLoad, "100%");
       cLoader.removeListener(oListener);
       delete _root.onEnterFrame;
       delete oListener;
       delete cLoader;
       _root.onEnterFrame = function()
          //trace(_root + "::onContentLoaded::_root.onEnterFrame");
                var nInc:Number = 5;
                mcLoader._alpha -= nInc;
                mcContent._alpha += nInc;
                if(mcLoader._alpha <= 0) startLoadedContent();
    function startLoadedContent(Void):Void
       delete _root.onEnterFrame;
       mcLoader.removeMovieClip();
       mcContent._alpha = 100;
       mcContent.play();
    function DrawRect(mc:MovieClip, nX:Number, nY:Number, nW:Number, nH:Number, nR:Number)
       trace("DrawRect in: " + mc);
       if(nR == undefined) nR = 6;
       mc.moveTo(nX+nR,nY);
       mc.lineTo(nX+nW-nR,nY);
       mc.curveTo(nX+nW,nY,nX+nW,nY+nR);
       mc.lineTo(nX+nW,nY+nH-nR);
       mc.curveTo(nX+nW,nY+nH,nX+nW-nR,nY+nH);
       mc.lineTo(nX+nR,nY+nH);
       mc.curveTo(nX,nY+nH,nX,nY+nH-nR);
       mc.lineTo(nX,nY+nR);
       mc.curveTo(nX,nY,nX+nR,nY);
    function SetTextFormat(txtField:TextField, sText:String)
       var txtFmt:TextFormat = new TextFormat();
       sText = "Loading... " + sText;
       txtFmt.font = "Verdana";
       txtFmt.align = "center";
       txtFmt.size = 11;
       txtFmt.color = 0x000066;
       txtFmt.bold = true;
       txtField.selectable = false;
       txtField.text = sText;
       txtField.setTextFormat(txtFmt);
       txtFmt = null;
    function Translate(mc:MovieClip, nX:Number, nY:Number):Void
       mc._x = nX;
       mc._y = nY;

    Hi kglad,
    The external swf is a movieclip (flv embedded with an AS3 layer to control the timeline) exported as an swf file .
    The first frame of the external swf is just stop();
    I didn't know the proloader code was AS2 though
    The preloader works fine with the external swf locally, but the problem happens when I run them from my server.
    The external swf itself and its code works fine from the server, both combined don't, so I guess the problem comes from the preloader. Probably because of the AS being 2 insted of 3.

  • Flash loading 60% in frame 0

    Hello,
    My flash movie is loading 60% in frame 0, so says the
    bandwidth profiler, this is a problem because my preloader doesnt
    show up until frame 1. I tried to change the settings for the
    publish settings/actionscript...no love. I did notice that when I
    went to Edit--Prefferences--ActionScript---ActionScript Setting
    that there is an option to Export frame for classes, but it is
    grey'd out. I dont have any components in the movie to set their
    export for a later frame, I m stumped!
    Has anyone had this problem, or know how to fix it? I would
    love the help =)

    Do you have any components in the library – even if
    they aren't being used?
    Other than that what do you have that would be taking up so
    much room in the first frame?
    Go to publish settings and check the box for file size
    report. That could help you figure out what is the bulk of the
    size.

  • New to flash actionscript, making a game.

    Hi. My name's Rory.
    I am an artist.
    http://www.youtube.com/profile?user=PimpOfPixels
    http://roaring23.cgsociety.org/gallery/
    I am learning action script and Flash so that I can make
    games.
    I am not a complete novice in programming. I am proficient in
    Java and in MaxScript (3DSMAX embedded language).
    I have been making some progress in action script and I have
    a functional (although incomplete) game in the works. You can view
    it here:
    http://secure2.streamhoster.com/~rlu...orniverous.swf
    The idea is it's a color game
    red beats green, green beats, blue beats red. Think paper
    scissor rock.
    The idea is to change the entire circle into one color.
    The graphics are place holders BTW.
    I am using FlexBuilder 2.0 and Flash CS3, and I have come
    across a problem not covered in either of my books.
    I'd really appreciate any help that you guys can offer.
    I have gotten this far on my own.
    My #1 question (and I have many more) is:
    How do you through Flash specify animation segments for a
    MovieClip Symbol?
    Notice how the red creatures occasionally open their mouths.
    I want to have a walk, an attack, an absorb, and a bounce animation
    on the same timeline and trigger the appropriate one depending on
    which color the creature collides with. I do not know how to go
    about this problem. I’ve just been trying to get the walk
    animation to loop without playing the attack animation so far.
    I've tried frame-labeling in flash, with scripts on the key
    frames of a second layer that specify when to stop or repeat the
    animation... No dice.
    I have a symbol named RedShot in the library of a flash
    project named "graphics"
    In my timeline I have 2 animation segments, and I have a
    second layer denoting two corresponding frames named "walk" and
    "attack" from the properties menu.
    On the final frames of the animations I have scripts.
    Code:
    gotoAndPlay("walk");
    and
    Code:
    gotoAndPlay("attack");
    respectively.
    Im my library I have linkage options specified as such:
    Class:RedShot
    BaseClass:flash.display.MovieClip
    export of actionscript#CHECKED
    export on 1st frame#CHECKED
    on the main stage of my flash project I have actionscript for
    2 functions:
    Code:
    function walk(){
    red_shot.gotoAndPlay("walk");
    function attack(){
    red_shot.gotoAndPlay("attack");
    I export the project and the opened window has the "walk"
    animation looping properly.
    In my FlexBuilder project I embed the symbol
    Code:
    //Inside class global variables:
    [Embed(source="../graphics.swf", symbol="RedShot")]
    public var RedShot:Class;
    private var _shot:MovieClip;
    Code:
    //and in my buildShot function:
    _shot = new RedShot();
    addChild(_shot);
    When I build the project the characters appear, and they
    animate. The only trouble is that there are no breaks in the
    animation. The animation loops right through the frames where I
    have specified that the animation should "gotoAndPlay" from a
    different part.
    What's weirder is that I can call
    Code:
    "gotoAndPlay("attack");"
    without an error and it will go to and play from that point.
    The only trouble is that it will begin to loop the entire animation
    again without stopping at the gotoAndPlay events stored in the
    frames of the timeline.
    It seems like all embedded actions are ignored, add I can't
    think of another way to controll the animation.
    Any thoughts?

    After hours of searching the internet I finally got this
    blasted question figured out.
    How to you export a symbol from Flash for use in a Flex
    Builder project without destroying actionscript stored within the
    frames of the Symbol's timeline?
    That's a long winded way of saying: "In FlexBuilder, how do
    you control MovieClips from Flash". I'm trying to make games, and
    this was a particularly important question for me :).
    Here's how:
    1) You need a hotfix from Adobe.
    [HTML]http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401493&sliceId=2[/HTML]
    This allows Flash CS3 to export a SWC file.
    2)You have to set the linkage properties for your various
    symbols in the flash library panel.
    a)right click on symbol in library panel
    b)choose "linkage"
    c)"Class:" = (pick a name)
    d)"Base class:" = flash.display.MovieClip;
    e)"Export for ActionScript" = CHECKED
    f)"Export in first frame"=CEHCKED
    3)If you want to have multiple segmented animations as I
    certainly did you'll want to create frames and actionscripts within
    the symbols timeline to define where these animations are.
    a) in the symbol's timeline make a second layer. We'll name
    that layer "labels" for the sake of not having this get too
    confusing.
    b) on that layer create a new frame for each of the animation
    segments that you'd like to define and stretch them to the length
    of the corresponding animations.(I'm assuming that you have a
    keyframe animation on the 1st layer... otherwise what's the point
    of all this :P?)
    c)in the properties panel name the frames in the "labels"
    layer accordingly ie. "walk" "run" shoot" etc.
    d)Define whether the various animations play once or loop by
    adding a script to the last frame of the animation. If you want the
    animation to loop add
    [CODE]gotoAndPlay("name-of-the-animation");[/CODE]
    if you want the animation to play once and stop add
    [CODE]stop();[/CODE]
    if you want the animation to play once and then return to a
    different animation add
    [CODE]gotoAndPlay("name-of-a-different-animation");[/CODE]
    4) now you can export the symbols to an SWC file. Note: you
    do not get this option unless you have installed the hotfix.
    [HTML]http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401493&sliceId=2[/HTML] .
    a)rightclick on a symbol in the library panel
    b)choose "exportSWCfile..."
    c)export the file to a logical place such as the root of your
    FlexBuilder project.
    5) Now you have to tell flexbuilder about the new SWC file.
    Note: Once this file is added to the FlexBuilder library you can
    instantiate classes from it as though they were included using the
    "include" function.
    a)Right clicking on the root of the project in the Navigator
    view.
    b)going to properties.
    c)Going to library path. (2nd tab)
    d)and pressing the "Add SWC" button
    Now you're done and you can instantiate any of the symbols
    from your library while preserving any actions from your symbols
    timeline just as though you had imported it as a class from a
    typical library.
    Sweet huh?
    Thanks to the countless people and internet resources I found
    on the subject. Hopefully it will be easier for anyone who finds
    this post.
    Here's an adobe video which covers the basic process.
    https://admin.adobe.acrobat.com/_a300965365/p75214263/

  • Load Multiple Dynamic Text Files in Different frames on Maintimeline

    Hello!
    I have managed to load an external text file in one place one the maintimeline. I would like to do the same thing on other frames. When I go to duplicate the same thing that I did on the first one I get a duplicate textReq request. Do I need to give the textReq a more specific name for each section? When I did this the movie wouldn't even recognize and of the code that was working before.
    Can anyone help me with this code? Thanks in advance
    I am attaching link so you can see sections I am talking about. Also you will notice that the swf file I loaded won't go away. That's another problem...ugh.
    Here is link:
    http://www.sandraschmitt.com/coclico/index100.html
    Here is code on maintimeline:
    stop();
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    function startLoad() {
        var swfLoader:Loader = new Loader();
        var swfRequest:URLRequest = new URLRequest("endlessCoclico3.swf");
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
        swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
        swfLoader.load(swfRequest);
    function onCompleteHandler(loadEvent:Event) {
        addChild(loadEvent.currentTarget.content);
    function onProgressHandler(swfProgress:ProgressEvent) {
        var percent:Number = swfProgress.bytesLoaded/swfProgress.bytesTotal;
        trace(percent);
    startLoad();
    //handle events for buttons...
    collections.addEventListener(MouseEvent.CLICK, clickSection);
    raison.addEventListener(MouseEvent.CLICK, clickSection);
    stores.addEventListener(MouseEvent.CLICK, clickSection);
    news.addEventListener(MouseEvent.CLICK, clickSection);
    contact.addEventListener(MouseEvent.CLICK, clickSection);
    home.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent) {
        //trace shows what's happening... in the output window
        trace("The "+evtObj.target.name+" button was clicked!");
        //go to the section clicked on...
        gotoAndStop(evtObj.target.name);
    Here is code on actual frame where the dynamic text is working:
    //Loaded exteranl text fields
    var textLoader:URLLoader = new URLLoader();
    var textReq:URLRequest = new URLRequest("text_philosophy.txt");
    function textLoaded(event:Event):void {
        philosophy_txt.text = textLoader.data;
    textLoader.load(textReq);
    textLoader.addEventListener(Event.COMPLETE, textLoaded);

    Textfields:  What I like to do, mainly for peace of mind, is to have a layer that I dedicate to actionscript that only has code in frame 1 but it extends the full length of the timeline so that this code is available to every frame on any other layer.  In this frame I put variables and functions that can get used/shared wherever they happen to be needed.  I usually create another separate layer for actions types of actionscript... stuff that happens at the local frame level, like stop();, or like assigning a variable a new value, etc... things local to being at that frame/location.  So with that in mind
    In frame 1 on my shared-by-everyone layer, I'd probably declare the variable....
    var textReq:URLRequest;
    And when I get to a particular frame where I want to load a new textfield with data, I assign that var its value on the local actions layer...
    textReq = new URLRequest("text_philosophy.txt");
    along with the rest of the local execution regarding loading the file, etc...
    SWF's:
    Yeah, pretty much, and it becomes an object that has a home on the timeline, so if you move away from that frame the swf doesn't follow.

  • How to resize everything on the stage in all frames

    Is it possible to resize everything on the stage in one (or a few) step? I know scaling the movie has the same result, but when working in Flash it's a lot easier when you see the actual size.

    If you have done all your animations avoiding actionscript, then you can select multiple frames and layers via the timelines "edit multiple frames" icon

  • Large First Frame???

    This is my first post so first of all, hi all...
    I am currently having a bit of a nightmare trying to optimize
    a flash file for use on the web. My first frame is currently about
    600kb in size even though the only thing on the timeline is the
    preloader, which is no where near this size.
    I have been using the attachmovie method A LOT, but have
    unchecked the export in first frame option for all movieclips that
    are attached in this way, and placed them on the stage in a later
    frame.(the correct way to get around this problem I believe?)
    I know importing classes is taking up about 100Kb of the
    first frame(because when i change the options in the publish
    settings to import them in frame 2 the size dips) but have no idea
    where the rest of this data is coming from, because it is not on
    the timeline. I can only assume that flash is importing something
    here, but I have no idea what it is.
    If anyone has any idea of why this is happening or has come
    across this problem before I would be so greatful because I feel
    like I have hit a brick wall.
    Thanks in advance,
    Ian

    I have used a combo box and button components but have
    definitely unchecked the export in first frame option.
    There is also a video play back in there but the linkage
    property is grayed out. Any way as far as I am aware this is not
    stirctly a component and even so would not be a couple of hundred
    kb right?
    Its very strange, I did think it may have something to do
    with the audio I am using but this is imported from an external
    source using the loadSound method on frame 3. Its getting to the
    point where I have totally run out of ideas, so thanks for any
    suggestions even if they just get me thinking along a different
    line.

  • Swf doesn't go to next frame after publishing??

    Hopefully a very simple fix here. I test my movie in Flash, even open it directly with the browser, and all is well. The gotoAndPlay works, and my animations look fine.
    However, when I publish the movie, and then test in the website, it stops after the first frame! What gives?
    Any help is greatly appreciated. Thanks

    Are you using some sort of actionscript comments like stop(); in the frame which might stop it playing once been loaded? If you want the gotoAndPlay to go to any specific frame you normally have to give them the frame number so something like gotoAndPlay (5); This tells it to go to frame 5 on the timeline.

  • After using modify/contents some frames go out of stage dimension

    Hello,
    I have a question to all you animators out there.
    I work in after effects and sometimes do some simple illustrations/animations in flash - where I usually switch the bg colour to gray
    as not to see the stage rectangular as it's distracting to me. Then when I have my drawings and a few different frames done I go to
    modify/ choose bg colour to white and check contents to frame all the content inside the document - then I want to export it to swf
    so I can use it in after effects.
    At this point all seems fine, all the frames are in place, however I noticed that frequently when I reopen my flash documet after having done this some frames are outside
    the white stage box (usually later frames, the 1st is in place).
    How do you deal with this?

    Hi all,
    Sorry for the slow response - as I'm sure you can understand, running lots of exports takes a few days and so it's taken me a while to test your suggestions properly.
    The render completes using the media encoder without crashing (MPEG2 Blu-ray and H.264 Blue Ray both worked), however the picture quality has really blurred:
    Original:
    MPEG2 Blu-Ray
    I also ran it in H.264 Blur-ray and this also appeared blurry. Apologies for lack of a screenshot, I deleted the export to conserve disk space.
    This is very similar to the problems I had under File => Export => Movie, which went away after I tweeked the export settings to match as closely as possible the footage (however Premiere then crashed when I tried to export the entire movie rather than just a clip).
    Working settings under File => Export which crashed Premiere but prevented the blurriness:
    Export
    Video and audio
    Entire Sequence
    Filetype
    QuickTime
    Video Settings
    Compressor: H.264
    Frame size: 1280h 720v (1.000)
    Frame rate: 29.97 frames/second
    Pixel Aspect Ratio: Square Pixels (1.0)
    Fields: No Fields (Progressive Scan)
    Audio Settings
    Compressor: Uncompressed
    Sample rate: 48000 samples/second
    Channels: Stereo
    Sample type: 16-bit
    Settings under Adobe Media Encoder
    Any thoughts what I'm doing wrong? This is starting to get really frustrating and I'm genuinely wondering if Premiere is suitable for what I'm trying to do. I've another project a month late in getting started because I want to get Premiere to export this so I know I'm not going to run into the same problems again - but I really don't know what else to try? Any ideas?

  • Getting flv to play frame to frame

    I have a 15 minute video that will play straight through or
    you can select a chapter point and it will go to that frame of the
    video, I'm using the seek method by telling it what frame to go to
    then play the video. Now I need to find a way to tell the video to
    play from one frame to another and stop at a later frame. Much like
    a DVD with chapter selection but only playing chapter to chapter.
    This is the code I have now to seek the video frame.
    on (release) {
    gotoAndStop(46);
    this.spanishversion.seek(62);
    how do I get the flv video to then play to frame 200 and then
    stop. If the video was a swf file this would be so much easier but
    its way to long.

    yeah so for the play all button, you would just have a button
    on it with just a flv.play() script on it.
    Just to explain the code i posted. The only things that you
    will need to change are the numbers in the parameters in the
    playChapter() function (where i currently have 5 and 7). Those
    numbers are your start time and stop time. Those numbers are then
    taken from that area and applied to the function where it was
    written in the first frame. Make sense? Basically you are declaring
    the function in the first frame, and then calling it when you click
    the button. Let me know if that makes sense.
    One thing you will have to make sure of is the encoding of
    the flv. If the keyframes in the encoding are set above every 30
    frames, you will run into problems because your video will want to
    then start at the next closest keyframe. I usually encode for
    keyframes every 30 frames to combat this.

Maybe you are looking for

  • Error while importing .par file into NWDS

    Hi Experts, For my query I saw a similar thread in sdn forum. the link is given below. /thread/382306 [original link is broken] I have unzipped the par file and inside this there is no other par file. So I have to import this par file only. Can anybo

  • How do I save/export as a TAB or SPACE delimited text file?

    Just upgraded from Apple Works to iWorks. The only text exporting option I see is .csv. Comma separation really screws up my needs. Is there a way to export as plain text? TAB or SPACE delimited?

  • Can anyone tell me from where origin and destination countries be picked

    Can anyone tell me from where origin and destination countries be picked for a vendor a having scheduling agreement Please consider the following points. 1. I need the table names 2. Table having combination plant and vendor Please help me on this

  • PSE 6 program and apps won't open.

    PSE 6 program won't open from the start menu or Windows Explorer and the editor and organizer apps won't open from Windows Explorer. All the files are listed in WE and not empty. This happened recently after I have used the program a few years. Do I

  • HT1338 iMac  + USB Superdrive NOT compatible?

    I have a 27"iMac whose internal Superdrive no longer writes DVDs or CDs. I tried cleaning ( Wet + Dry methods) with no success. Instead of a costly repair or a possibly botched DIY fix, I had a cunning plan! I bought an External USB Superdrive! Assum