Help with ActionScript

I was recently done in ActionScript, and I'm over my head. I need help.

I want to do is to have a series of images that scroll. However, I would also like to have back and arrows according to, so you can change the images manually.

Here is where I am now:

I have two movie clips - I want to switch between two images.
I have two buttons next and back.

I am able to make the arrows to work, if I go to a certain slice, but if I try to get to go to a specific movie clip name, I get an error.

Here is the ActionScript code I currently have:

function nextclip(event:MouseEvent):void
{
image1_mc. Play();
}
next_btn.addEventListener (MouseEvent.CLICK, nextclip);


I guess I'm not sure I'll even on this the correct way. Is there a way to advance to the next image, without having to specify what is the name of the instance of the image?

Please help me! I'm quite confused.

You can keep the images on consecutive images (not the space 10 frames) and simply use nextFrame() and prevFrame() for arrows next and previous. Regarding the second loop 10, you can use a timer. (I'll do my best to explain)

var: clock = new Timer (10000);
Creates a new timer under the name of the clock object and sets it to check every 10 seconds (10 000 milliseconds, change at your convenience)

clock.addEventListener (TimerEvent.TIMER, moveNext)
Adds a listener to the clock. Ticks of the clock every time, the listener will start the function called moveNext

Clock.Start ();
Starts the clock (will be start ringing every milliseconds x (however you define it))

function moveNext(event:TimerEvent) {}
If (currentFrames == totalFrames) {}
If it's the last image > Stop at frame 1
gotoAndStop (1);
} else {}
If this is not the last picture > goto the next image
nextFrame();
}
}

Hope this helps ;-)

Tags: Adobe Animate

Similar Questions

  • I need help with actionscript 3, sending information php to my email, Web site created in Flash pro cs5

    Hi, my name is David and I took a course to create my own website of Lynda.com by Paul Trani. After that, I created my first own webste. After that I finished it, everything worked well in flash and firefox. I have one problem or question about the power form back to send information of my website at my emailaddres. I created my website 'LisbonDreamWalking' in Flash pro CS5. I have a contact page, where people can send an e-mail for a walk in Lisbon, the date, the number of people etc. Now I want through my ISP / host funpic.org, as the entry info fields of text to be sent to my emailaddress [email protected]. My mail URL address iss: http://lisbondreamwalk.li.funpic.org This is a free webhost, so they do not work with forms as in the course, and I need some additional Info for php. Here is my HTML (Flash actionscript 3.0) to send, I don't have that red text to fill (php), I was told by the adobe course. I really hope that someone can help me? Thanks in advance!

    Instructions: 1. Add your custom code on a new line after the line that says "/ / Start your code custom" below. The code runs when the user clicks the symbol instance. * / send_btn.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_13);  function fl_MouseClickHandler_13(event:MouseEvent):void {if (thename.text == "": theemail.)} Text == ' | thetime. Text == ' | thepersons. Text == ' | TheMessage. Text == "") {thankyou.text = "Please fill out all fields';      } else {/ / create a container var allVars: URLVariables = new URLVariables();}           allVars.name = thename.text;           allVars.email = theemail.text;           allVars.time = thetime.text;           allVars.persons = thepersons.text;           allVars.message = themessage.text;           Send the info to a URL var mailAddress:URLRequest = new URLRequest ("http.www.namewebsite.com/gdform.php");           mailAddress.data = allVars;           mailAddress.method = URLRequestMethod.POST;           sendToURL (mailAddress);            Thankyou. Text = "Thank YOU!"           theName.Text = "";           Theemail. Text = "";           thetime. Text = "";           thepersons. Text = "";           TheMessage. Text = "";      } }

    H

    your code and my code are not the same.  Copy and paste the code that I have proposed.

  • fade out dynamic text only fading. Need help with actionscript

    Hi all

    I hope someone can help me. I have a dynamic text I want to fade and then fade out and then disappear in another bit of copy. My text fades but is not melted, paragraph disappears and then evokes the next paragraph suddenly. All the basic ideas on the code that I have attached here? Let me know if you need more.

    Thanks a lot for your help. I finally found it and done in a much simpler way with much less code. I used symbols that I mentioned in previous posts, following this same actionscript help basis but put my video clips on frame 1, used a stop action and ended up with PlayMC()

  • falling snow: pls help with actionscript

    Hallo,

    I made a flash animation with the snow that falls from the sky in Flash 8 (actionscript 2.0)

    However, the snow, I did differs from the original.

    The original is here:

    http://www.Kirupa.com/developer/MX/snow.htm

    I put mine here:

    http://toetssite.webs.com/

    You will notice that my only falling snow down: there is no randomness for the flakes to go left or right. There is no movement.

    Where in the script below can I change this so that there is more movement for flakes? Thank you

    I use the following script for the snow itself:

    onClipEvent (load) {}


    Specifies the size of the movie scene
    movieWidth = 300;
    movieHeight = 200;

    variables that alter the snowfall
    I have = 1 + Math.random () * 2;
    k = - Math.PI + Math.random () * Math.PI;

    What gives each snowflake unique features
    This ._xscale = this ._yscale = 50 + Math.random () * 100;
    This ._alpha = 75 + Math.random () * 100;
    This ._x = - 10 + Math.random () * movieWidth;
    This ._y = - 10 + Math.random () * movieHeight;
    }
    onClipEvent (enterFrame) {}
    restore the
    += rad (k/180) * Math.PI;
    this ._x-= Math.cos (rad);
    This += i ._y;
    If (this ._y > = movieHeight) {}
    This ._y = - 5;
    }
    If ((cette._x > = movieWidth) |) (cette._x < = 0)) {
    This ._x = - 10 + Math.random () * movieWidth;
    This ._y = - 5;
    }
    }


    and on the first frame of my movie, I put the following:

    for (k = 0; k < 50; k ++) {}


    duplicateMovieClip (this.snow, "snow" + k, k);


    }

    Thank you!

    Just initialize the variable rad. I added following line to your code and it works fine.

    rad = 0; a line that I inserted.

    No other changes required. It is advisable to initialize all variables before using them.

    in any case, below, that I provided all script for snow after change

    onClipEvent (load) {}

    Specifies the size of the movie scene

    movieWidth = 300;

    movieHeight = 200;

    rad = 0; a line that I inserted.

    variables that alter the snowfall

    I have = 1 + Math.random () * 2;

    k = - Math.PI + Math.random () * Math.PI;

    What gives each snowflake unique features

    This ._xscale = this ._yscale = 50 + Math.random () * 100;

    This ._alpha = 75 + Math.random () * 100;

    This ._x = - 10 + Math.random () * movieWidth;

    This ._y = - 10 + Math.random () * movieHeight;

    }

    onClipEvent (enterFrame) {}

    restore the

    += rad (k/180) * Math.PI;

    this ._x-= Math.cos (rad);

    This += i ._y;

    If (this ._y > = movieHeight) {}

    This ._y = - 5;

    }

    If ((cette._x > = movieWidth) |) (this ._x<=0))>

    This ._x = - 10 + Math.random () * movieWidth;

    This ._y = - 5;

    }

    }

  • Pls see SWF and help with Actionscript

    I'm trying to get my nails of the thumb (which is the individual buttons) to display in the box to the right when you click on it, but I don't know the code to put on the buttons for that to happen. Can someone help me please.

    http://www.geocities.com/demetriusmcclain/

    Here are your files in this way, they should be programmed. There is a minor change in your file main eoa.fla (with the path to elephants.swf) and major changes to elephant.fla:

    www.geocities.com/kglad99/eoArts.zip

  • Quiz Flash need help with actionscript


    Hallo,

    I made a quiz in flash with four Pages:

    1. "welcome to quiz," etc. with a button to GO to THE QUIZ.
    2. the real test with two possible answers
    3. the correct answer
    4. wrong answer with link to start again.

    I've added the following script to jump between the pages:

    {We (Release)}
    gotoAndPlay (pagenumber)
    }

    It works perfectly. But...

    I would like to add several quiz that I figure out on my own, but I want to add a kind of counter, which, at the end of the quiz, will give a percentage or a count for example. 7/10 - 70% congratulations! or something like that.

    Anyone have an idea how I wanted to write this script?

    I am a total newbie Flash is told by the way!

    Thank you very much!

    Create an action layer that extends through all your pages and set an outcome variable...

    var score = 0;

    Maybe for each correct answer you increment the value 1...

    score += 1;

    When you arrive at the end or somewhere else, you have a textfield and you use the value of note in there somehow...

    tField.text = "you answered" + score + "out 10 correctly»;»"

  • Beginner, need help with ActionScript 3.0

    Hi all
    I am a newbie to flash and have little experience with OBJECT oriented programming (and therefore of action script), so I apologize in advance for my lack of knowledge. I think it is easy enough to fix, just don't know the syntax or if there is a better way to do it. Here's my problem:

    I created a flash file which has a card (like a layer of the base image) with 4 quadrants, I created separate layer (converted to a button) which corresponds to the limit of 1 of the 4 quadrants, and added a simple script, I copied and modified since a tutorial Adobe (see syntax). Instead of a new webpage to appear and the text output "I clicked" I want a new window appears with the plan of each quadrant (which is another image, jpg).

    I don't know what is the syntax to call this new image upward once your mouse over individual quadrant.

    Thank you

    Try this code. It should simplify what you want to do. Just replace the real names of new html documents that you want to open.

  • Help with Actionscript error

    What I try to achieve is to read from an XML file to be located in my assets folder in my project directory.

    So as I will try to use the concepts of E4X for XML data, I started writing my code but get an error message as follows: 1120: access of undefined property contactsXMLLoader

    Here is my initial code that gives the error on the last line:

    import flash.net.URLLoader;
    import flash.net.URLRequest;

    var contactsXMLLoader:URLLoader = new URLLoader();
    contactsXMLLoader.load (new URLRequest("assets/mydata.xml"));

    Not sure why this error occurs?
    Also is there a way of FlexBuilder 3.0 to view the actual code of the URLLoader and URLRequest classes? Where and what files is the content code in, if any?

    Thank you

    hkpadobe,
    recently, when I saw someone else after an error of this kind, the code they were studying with was not really in any, but simply written method directly in the block. Have you tried to put these lines in a method such as creationComplete() - eg


    import flash.net.URLLoader;
    import flash.net.URLRequest;

    public function setup_items (): void
    {
    var contactsXMLLoader:URLLoader = new URLLoader();
    contactsXMLLoader.load (new URLRequest("assets/mydata.xml"));
    }
    etc etc.
    Richard

  • Help, please! Stimulation with ACTIONSCRIPT

    Hello!

    I'm trying to move objects with actionscript 3.0 and I have need of events comes after other events are complete. I tried a setTimeout, but none of the events that happened even if some of them had very low times. I heard of house order snaps to the nearest keyframe. I am convert motion tweens to ActionScript to greatly reduce the size of the file, so I have only a few images and the nearest keyframe would be way too close.

    If you have another order that wouold work better or advice that would help me to reduce otherways, please offer it.


    Thank you!

    Problem solved.

    Thank you all for your help.

    -J

  • Newby needs help with external text and the madness of the actionscript.

    Hello

    Try to load an external plain txt file into a field of text with Actionscript 3.0. The text file is saved in UTF-8 format in the same file as the Flash movie and I use the following code:

    var external_txt:TextField = new TextField();
    var externalReq:URLRequest = new URLRequest ("external.txt");
    var externalLoad: URLLoader = new URLLoader();

    externalLoad.load (externalReq);

    externalLoad.addEventListener (Event.COMPLETE, textReady);

    external_txt.x = 175;
    external_txt.y = 100;
    external_txt. Border = true;
    external_txt. Width = 200;
    external_txt. Height = 200;
    external_txt.WordWrap = true;

    addChild (external_txt);

    function textReady(event:Event):void
    {
    external_txt. Text = event.target.data;
    }

    When I test the movie, the following error message appears in the output window:

    Error #2044: Unmanaged by ioError:. Text = Error #2032: error flow. URL: file:///F|/FlashCS3/FlaFiles/external.txt
    at ScrollingTextField_fla::MainTimeline/ScrollingTextField_fla::frame1()

    I know that the solution is probably very simple, but I'm new to Actionscript and it cannot work around. Anyone have any suggestions?

    Scoots


    Your Kglad,

    Check my folder options and had the type of file extensions hidden, was "external.txt.txt" as the URL of the request. Sorry guys!

    Thanks again!

  • Help with my animation film...

    Hello

    I know this can be annoying, or whatever, but I'm stuck with this project, which must be done in Flash and I can't just deal.

    I can only do the basics really motion, tween, etc..

    http://24.media.tumblr.com/tumblr_mbye4wq1qU1qe31lco1_r1_1280.jpg

    I wish that the heart of the animation that gun shot of the pencils.

    So I need help with two things that I think; How to make the gun appear as if he is shooting itself? I would like to make the trigger slightly and the top bit move backwards and then turned to create the shot.

    Then I would like to follow the 'miracle' as his driving, so I was thinking of this sort of background blur/running to make it appear as if she steals the pencil?

    How possible are these things to do?

    Can you please help me:

    Thank you.

    Each pencil must be a separate movieclip.  You then animate just like any other object using the interpolation of the timeline or actionscript of flash.

  • Loading of local swf files with actionscript on air for iOS

    I apologize if this seems like it has already been asked, but I'm not sure that having understood the answer, not on the Adobe site, or elsehwere.

    I am developing an app for iOS, targeting the last 3.9 SDK

    I have a main swf file that loads the local swf files. These local swf files have code actionscript in them. I use Flash Professional CS6.

    I publish the application successfully and everything's fine. When I start the app on the iPad, is the main swf and all is well. When I click on the button that loads the local SWF files, nothing happens. They are not loaded.

    It seems that this has been answered, but I'm losing my mind. I don't know what the problem is. I know that, in version 3.9 Air, it is now possible to load local SWF files are actionscript.

    Air for the Android version works perfectly with these local files loaded and unloaded like a charm.

    Any help would be greatly appreciated

    from the air, 3.6, you can load swf with actionscript and that run actionscript.  before 3.6 air that was not allowed (without additional work).

    but your charger must provide a loadercontext object that uses the current applicationdomain:

    var lc:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain,null);

    yourloader. Load (yourexternalswf.swf, LC);

  • Change the size of 'police' in a TLF Textfield with actionscript?

    I couldn't realize how do I resize my TLF Textfiels in cs6 flash with actionscript?

    None of them has worked:

    If (...)

    {

    myTLFText.textSize ++;

    myTLFText.fontSize ++;

    }

    Error: Access of size property possibly not defined through a reference with static type fl.text:TLFTextField.

    I appreciate your help please?

    definition of width/height is no help.  Use scaleX and scaleY as I suggested.

  • Load SWF a remote server with ActionScript in AIR base iOS ipa

    Hi Nimisha1,

    Can you please confirm if I can SWF load of distance on the server with ActionScript in AIR iOS ipa?

    Any help regarding this is appreciated.

    Thank you

    Amandeep Singh

    Hi Steve,.

    You cannot load a swf file on a remote server that contains ActionScript.

    Thank you

    Nimisha

  • Help with existing AS2 code to rotate an object

    I have an item I want to turn 3D (letter 'Y'). I have a code I put together and edited it a bit, but right now she turns at the top left because he is anchor. I try to turn it to the 'heart' of the Y (absolute Center), so it is essentially in place.

    My second problem is the speed. Ideally, it should turn very quickly and then slow down and stop. Any thoughts on how to clean either this code to make it work? I'm pretty new, so any help is appreciated. I could try with only a transformation of the form, but I'm trying to see if it can be cleaner with Actionscript. Thank you!

    Here is a link to the CS4 .fla file if that helps.

    http://Board.flashkit.com/board/showthread.php?p=4296719#post4296719

    scaleDirect = -1;

    DEC2HEX function ()dec ()

    {

    if ( dec > 15 )

    {

    POS1 = hexChars. charAt() ( Math. floor ( dec / 16 ) );

    POS2 = hexChars. charAt() ( dec - ( pos1 * 16 ) );

    } else

    {

    POS1 = 0;

    POS2 = hexChars. charAt() ( dec );

    }

    Hex = pos1 and pos2;

    return hex;

    }

    this. ( onEnterFrame = function()( )

    {

    letterMC. _xscale += scaleDirect * Math. floor (1+ ( 101-Math. ABS() letterMC. _xscale ) )/2 );

    if ( ) letterMC. _xscale < = -100 | letterMC. ( _xscale > = 100 )

    { scaleDirect * = -1;} }

    }

    don't use acceleration in your _xscale property:

    this.onEnterFrame = function()

    {

    letterMC._xscale += scaleDirect;

    If (letterMC._xscale <= -100="" ||="" lettermc._xscale="">= 100)

    {scaleDirect * = - 1 ;}}

    }

Maybe you are looking for

  • Card chipset drivers mother HP pavilion dv6 - 1367ca

    Hi I recently reformatted my laptop and im from problems with the drivers for it. I have all my other drivers properly installed next to my netwrok realtek driver and my driver chipset. When you go to the page of the driver for my laptop http://h1002

  • Sign on the question

    I have reset my password of msn account. I couldn't do it from MY laptop, so I had to use my wife's cell phone. I managed to reset my password and I am able to access my account on my computer using msn mobile wifes. I go to MY laptop and enter the n

  • Where is tools?

    I just got a new HP laptop and I am trying to enable Silverlight that is installed on my computer. So I can watch movies on Lovefilm. He to tell me to change it to activate in TOOLS. Where is the tools and how to do for her.

  • HP Pavilion s3270y: from window to window 7 No. Hp media center missing vista

    Can you please send a response to my question.  I guess I shouldn't post my email because it's on a forum.  I am not able to find this forum again.  But I hope that you have that info to the registry.  Thank you. Question: Since the download of windo

  • I need to know which ports are pregnant?

    I need to know which ports are for speakers?