Creating action of the loop with movieclip

Hello

I don't know if this is the right place to ask questions about actionscript, but I'll go ahead and after... Please inform me if I'm posting in the wrong place!  Thank you!

Here are my questions... I created a thumbnails bar and added the as3 code for the fact imagebar scroll to the right or left depending on where the mouse pointer is located. However, once you reach the end or beginning of the clip it stops right. How can I do loop at the beginning or at the end (depending on how you are scrolling? I am very new to Flash and as3 as a warning.

Here is my code so far. (I'm just stick in, y at - it a particular way to do this?)

Thank you

Giuseppe

MovieClip (root) .addEventListener (Event.ENTER_FRAME, enterFrameHandler);

function enterFrameHandler(event:Event):void
{
If (MovieClip (root) .mouseX > 600 & & mouseX < 800 & & mouseY > 450)
{
imgBar.nextFrame ();
}
If (MovieClip (root) .mouseX > 800 & & mouseY > 450)
{
imgBar.nextFrame ();
imgBar.nextFrame ();
}
If (MovieClip (root) .mouseX < 300 & & mouseX > 100 & & mouseY > 450)
{
imgBar.prevFrame ();
}
If (MovieClip (root) .mouseX < 100 & & mouseY > 450)
{
imgBar.prevFrame ();
imgBar.prevFrame ();
}
}

FTGLM wrote:

I don't know if this is the right place to ask questions about actionscript...

This is the Flash Player forum; If you have a question about ActionScript, post it in the forum of ActionScript.

Tags: Flash Player

Similar Questions

  • Stop the loops with a button

    I have an infinite loop is and display of data. How can I end the loop with a button or a keypress?

    Periodically perform a ProcessSystemEvents() call inside the loop. In a reminder of the STOP button, set a flag to indicate your loop to stop.

    stop unsigned int = 0;

    While (! stop) {}

    data getmeasured

    display the data

    ProcessSytemEvents()

    Sleep (250);   to be polite: it is impolite to spinlock, since you will monopolize the CPU and other threads can get hungry

    }

    then, in the reminder for a STOP button

    STOP the button callback routine

    stop = 1;

  • VISA resources between the loops with the queue

    Hi all

    I am just be familiar with the queues and the producer/consumer model, and I am facing difficulties to pass data between the loops using queues, including data of the type "VISA Resource Name.

    Indeed, it seems impossible to cable "VISA Resource Name" as an entry of the item in the queue, as an output of the Dequeue item.

    These screws can I always try to convert something of this type can accept? Or should I take a different approach and that one?

    Thank you very much for your help.

    Florian


  • synchronize the loop with the time on the computer

    I'd like to run a while loop exactly all the 1 minute, with the minute that occur according to the time on the computer at 0 seconds.

    a timed loop runs a minute after the loop is started and is not synchronized with the 0 seconds of time on the computer.

    How do I get there? I realize the first loop will be less than 1 minute, due to the synchronisation.

    Thanks, that helped me.

    I thought at the start of the second 1 loop would consume resources additional, but realized it's negligible.

    I ended up using quotient/remainder on time on the computer in seconds and checking when the remainder is 0, as this allowed for the second interval.

  • Sync the sound with MovieClip

    Hi people, I was wondering if someone could help me with my current problem - synchronization to a background music with a movieclip. I am aware that you can place a sound directly on the timeline of a movieclip: it was my first attempt to sync the two upward. Unfortunately the problem with this is that the sound (which is quite long), then will not STOP until its reading that I stop the movieclip or remove from the scene ends. I have also no control over the volume in this way.

    The only other method I can get to that is to keep track of the current image of the mc and trigger the sound manually, but this is still going out of sync if too many things happening at the same time and the framerate drops. I really need to be specific, so it's not great.

    Are there other ways to synchronize the sound upward? Or y at - it a way to get the sound to stop when I want to my first method?

    Thanks in advance,

    Dinkyfish

    If you attach your sound to your calendar and in the properties panel set the stream sync, it will probably work as you wish.

  • Creating instances in the loop

    Hello.

    I m creating a prototype of tiles.

    To put the tiles on the stage using the I m:

    private void addTiles(columnNumber:int,_rowNumber:int):void {}

    for (var i: int = 0; i < columnNumber; i ++)
    {
    for (var z: int = 0; z < rowNumber; z ++) {}

    var: tile = tile new (tiles.addChild (Tile()));

    rest of the code not shown
    }
    }

    }

    Where "tiles" are the container of each tile.

    Is a dynamic way to create an instance of a tile?

    A question:

    The instance is created within addChild, will be stored in the variable ´s 'tile '?

    If Yes, after the function "addTiles" end of execution, the Tile class instance will be

    be eligible for garbage collection, right?

    Second question:

    The reference to the instance is created through new Tile(), is "mosaic" (variable)?

    If the instance is accessible within the scope of the buckle through the variable 'tile', right?

    Third question:

    Is there a full path as as2?
    In as2, so I would like to trace "tile" it would output "tiles.tileInstanceName", so that I could access the instance of tileInstanceName using only the variable 'tile'. "

    A full path to the object.

    It is no longer possible?

    Thank you

    A question:

    As long as they are on the scene, they should not be eligible for garbage collection.  It would be difficult to get them well, since there is no direct reference.

    Best way to handle this would be to create an array and store them there.

    public var tilesArray:Array = new Array();

    private void addTiles(columnNumber:int,_rowNumber:int):void {}

    for (var i: int = 0; i< columnnumber;="">
    {
    for (var z: int = 0; z)<>
        
    var: tile = tile new (tiles.addChild (Tile()));

    tilesArray [z] .push (tile);

    rest of the code not shown
    }
    }

    }

    This creates a table to 2 dimensions of your tiles so that tilesArray [0] is the set of line 1, tilesArray [1] is the set of line 2, etc.

    Then later in your code you can access directly using the "tilesArray [0] [1] tilesArray [1] [2], etc..  or simply make another loop to go through all the.

    Just make sure to note what order you put them in the table so that you know if tilesArray [0] is the first row or first column.

    Second question:

    Fix.  Because you created the variable tile inside this loop is accessible only by the name tile it.  Outside this loop, you will need to access either through their container parent using something like getChildAt (which can be very clumsy and is not recommended), or by storing them in an array, such as mentioned in the answer to question 1.

    Third question:

    I've never worked a lot with AS2, so I'm not 100% sure.  In all the work I've done with AS3 I've ever met an any direct instance like that name.

  • for loops with movieclips

    Hello:

    I have twenty movieclips on stage with these names:

    G1

    G2

    G3

    G4

    ....

    How to make invisible with a loop for, as

    for (i = 1; i < 20; i ++)

    {

    g + i.Visible = false;

    }

    What does not work.

    Can you help me, please?

    for (var i: int = 1; i< 20;="">

    {

    This ['g' + i] .visible = false;

    }

  • Stop the loop of movieclip

    Hello

    I am doing a map in flash, and when you transfer a name of a company (button) the construction of this company light up.

    Which works very well. The card is a MovieClip. I did this movieclip keyframes (pages).

    In the first keyframe, I entered stop();

    That worked well, but not for long. I wanted to put a few button with URL links in diffirent Keyframes (pages).

    When I typed the code so that it worked fine on the first keyframe. When I came to the second keyframe and make another button with link.

    When I tested the continuous MovieClip to play again and again and does not listen to stop(); more.

    How can this occur and why?

    Can someone help me?

    Sorry for the bad English.

    Joep

    Do you get any error messages?  What is the code you use on the different frameworks? Your keyframes are separated by empty frames?

  • change the url of the browser with movieclip, onrelease

    I have an actionscript code that affects 10 movieclips in a table, I can scroll through the table. I want to add my method to onRelease movieclips listener function to chane the current broswer url (not the launch a new window).

    Use getURL() with the first parameter of the url and the second, '_self '.

  • Creating table in the model with 80 columns

    Hello

    I am trying to create a model to display 80 columns, but in Word format, I get the message "you cannot create a table with more than 63 columns.
    Can how I put the 80 columns in the Template.rtf?

    Env: Suite Oracle E business 12
    Output required: Excel

    Thanks in advance.

    It's the MSword limitation and no BEEP, but indirectly there is a limitation of the BEEP ;)

    MSWord supports only maximum of 63 columns.
    As MS Word supports only the width of page maximum of 22 inches wide and 22 inches high.

    Option 1:

    Create a table with two columns
    Insert a table with 63 columns in the first cell,
    Insert a table with 63 columns in the second cell,
    How we can get rid of limitations columns.

    Option 2:

    If you want to use more than 63, then you use templates other than RTF. I recommend XSL.

  • How can I create and display the cuboid with a texture?

    I want to create and display and animate (rotation and Flex) a cuboid with a specific texture for any side. Can someone help me?

    You should probably look into a 3D engine like Sandy3D or Away3D.

  • Bug in the conditional for loop with an array empty

    There seems to be a bug in the loop with a conditional terminal.

    If an empty array is connected to an indexed table auto entry tunnel, a tunnel of output array has an element instead of zero.

    The constant matrix is left empty.

    High loop without the conditional Terminal produces an empty array.

    Conditional down with a terminal loop never true generates an array containing a single element

    Thanks to LabVIEW version 8.5


  • For loops with the cursor line and indexing

    Hi all

    I have a question about the loops with the cursor, line and indexing.

    How can I scan via a cursor with an iterator?

    I would use an iterator as

    Whole LoopIndex;
    Whole LoopIndex2;

    for LoopIndex at the beginning of the cursor at the end of the cursor
    loop
    line =: cursor [LoopIndex];
    for LoopIndex2 of LoopIndex at the end of the cursor
    etc...
    end loop;

    I need to use an iterator because I need to use a nested for loop.



    OR


    How can I solve the following problem?

    Class name % ofClass average test Score
    1 Niobe 7 8 8.4
    1 alena 4 7 7.5
    1 9 7 8.9 Estia
    1 Lilly 10 8 9.8
    1 Sandra 6 8 8.3
    1 Melanie 8 8 8.1
    Nadia 2 8 3 4.4
    Sayuki 2 9 8 8.4
    Diasy 2 7 8 8.0
    Flower 2 7 8 6.5
    Diana 2 6 8 7.3
    3 Flora 7 8 5.8
    Sukiya 3 4 8 8.4
    Samantha 3 10 8 7.7
    Roxanne 3 7 8 6.9
    Eline 3 8 8 7.4

    I need to
    -By class, I need to recalculate each average people
    -By class, I need to calculate the % of class score (sum averages / people in the class)

    So it can be done in a nested for loop?
    Or do I just step by step?

    Well, based on this information it would be something like...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 1 as Class, 'Niobe' as Nm, 7 as Score, 8 as Tests, 8.4 as Average from dual union all
      2             select 1, 'Alena', 4, 7, 7.5 from dual union all
      3             select 1, 'Estia', 9, 7, 8.9 from dual union all
      4             select 1, 'Lilly', 10, 8, 9.8 from dual union all
      5             select 1, 'Sandra', 6, 8, 8.3 from dual union all
      6             select 1, 'Melanie', 8, 8, 8.1 from dual union all
      7             select 2, 'Nadia', 3, 8, 4.4 from dual union all
      8             select 2, 'Sayuki', 9, 8, 8.4 from dual union all
      9             select 2, 'Diasy', 7, 8, 8.0 from dual union all
     10             select 2, 'Blossom', 7, 8, 6.5 from dual union all
     11             select 2, 'Diana', 6, 8, 7.3 from dual union all
     12             select 3, 'Flora', 7, 8, 5.8 from dual union all
     13             select 3, 'Sukiya', 4, 8, 8.4 from dual union all
     14             select 3, 'Samantha', 10, 8, 7.7 from dual union all
     15             select 3, 'Roxanne', 7, 8, 6.9 from dual union all
     16             select 3, 'Eline', 8, 8, 7.4 from dual)
     17  --
     18  -- END OF TEST DATA
     19  --
     20  select class, nm as "NAME", score, tests, average
     21        ,round(((average*tests)+score)/(tests+1),1) as avg_person
     22        ,round((average / sum(average) over (partition by class))*100,1) as class_average
     23  from t
     24* order by class, nm
    SQL> /
    
         CLASS NAME          SCORE      TESTS    AVERAGE AVG_PERSON CLASS_AVERAGE
    ---------- -------- ---------- ---------- ---------- ---------- -------------
             1 Alena             4          7        7.5        7.1          14.7
             1 Estia             9          7        8.9        8.9          17.5
             1 Lilly            10          8        9.8        9.8          19.2
             1 Melanie           8          8        8.1        8.1          15.9
             1 Niobe             7          8        8.4        8.2          16.5
             1 Sandra            6          8        8.3          8          16.3
             2 Blossom           7          8        6.5        6.6          18.8
             2 Diana             6          8        7.3        7.2          21.1
             2 Diasy             7          8          8        7.9          23.1
             2 Nadia             3          8        4.4        4.2          12.7
             2 Sayuki            9          8        8.4        8.5          24.3
             3 Eline             8          8        7.4        7.5          20.4
             3 Flora             7          8        5.8        5.9            16
             3 Roxanne           7          8        6.9        6.9          19.1
             3 Samantha         10          8        7.7          8          21.3
             3 Sukiya            4          8        8.4        7.9          23.2
    
    16 rows selected.
    
  • several loops with error handling and controll

    I have a project where I spin 4 loops at the same time and must stop all the loops with a stop button as well as all the loops if one of the loops will receive an error.

    Loop 1.

    Loop start

    control the other 3 loops

    Loop 2.

    Analog voltage reading

    Loop 3.

    Digital inputs to read

    Loop 4.

    Write digital output

    Someone knows how to do this?

    Two other methods not mentioned in the otherwise excellent document that mentioned Matt are the use of a global variable 'stop all' and a relative using a Global Variable of VIG/functional.  The reason to talk about, is that they can be used also stop 'detached' live, live which are defined to run asynchronously (and therefore a bit 'out of control') regarding the main VI.

    I use a "combination of ingredients" for some projects I'm developing using LabVIEW 2016 and its support of the channels.  For example, I use a Messenger channel to create something akin to a message in queue manager.  When the event loop detects that the exit button has been pushed back, it puts a Message "Exit" on the channel of Messenger and stops himself.  When the Message Loop sees "Exit", it sends one release Message who else has need to see (in one case, the producer of a producer/consumer model) and stops himself.  When the producer Gets the output Message, it puts a "last element is invalid" on the flow of the channel for consumers and stops himself.  When the consumer gets the message of the last element, he stops himself.  A magnificent waterfall.

    And I work (not yet 100% complete) how to extend this to start the asynchronous calls that do not (yet) support channels as easily...

    Bob Schor

  • conditional of the loop will not control read in a business event

    I made a simple conditional to the loop, with a timer and a generator of random numbers in the loop as a stop button attached to the conditional stop Terminal.  Everything works well and stop the loop when I click on the stop button. But I then wrap the conditional for the loop with a structure event and create an event to run the conditional for the loop.

    To my surprise, when I run this updated VI I can never get the loop to stop via the wired button until the conditional terminal stop.  How is what happens? And how to do this?

    change the case of the event > UNCHECK block façade up to the case of finishes (or whatever this text indicates actually in the lower left corner of the pop - up of the event edit)

    (~ ~ ~ oh-Magic 8-ball ~ ~ ~)

Maybe you are looking for