PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : actionscript zähler in flash 5


hippie
30.04.2001, 21:31
ist es möglich in flash5 einem movieclip die aktion zu geben, bei einer gegebenen zahl anzufangen und dann in ebenfalls gegebenen intervallen bis zu einer gegebenen endziffer zu zählen?

der zähler soll nichts "zählen" sondern eher wie ein kilometerzähler einen imaginären zählvorgang visualisieren.


mfg,
hippie

Cyberlink
01.05.2001, 20:21
habe dir hier mal eine anleitung (und hoffe du kannst gut englisch :))

so sieht das ganze am ende aus:
(hmm geht irgendwie nicht..seltsam versuch einfach mal diese seite hier:)
http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/perpetual_counter.swf

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,0" ID=perpetual_counter WIDTH=30% HEIGHT=30%>
<param name="_cx" value="5900">
<param name="_cy" value="3863">
<param name="Movie" value="http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/perpetual_counter.swf">
<param name="Src" value="http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/perpetual_counter.swf">
<param name="WMode" value="Window">
<param name="Play" value="0">
<param name="Loop" value="-1">
<param name="Quality" value="High">
<param name="SAlign" value>
<param name="Menu" value="-1">
<param name="Base" value>
<param name="Scale" value="ShowAll">
<param name="DeviceFont" value="0">
<param name="EmbedMovie" value="0">
<param name="BGColor" value="#ffffff">
<param name="SWRemote" value><embed SRC="http://www.chemieonline.com/forum/bilder/cyberlink/informatik/perpetual_counter.swf" swLiveConnect="FALSE" WIDTH="50%" HEIGHT="50%" QUALITY="high" BGCOLOR="#FFFFFF" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></OBJECT>

hier die anleitung:

Stage 1 - Numbers

Start by making the movie clips (The number of movies depends on how many numbers you want - this example goes to the millions place (7 places = movies) - but you can use less

Name the first movie clip number1

Each movie clip will have 11 keyframes

http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/counter_perp1.gif

The 1st frame starts with 0 - then each keyframe after that 1,2,3,4,5,6,7,8,9

The easiest way to align everything is to choose your font and size of the numbers - place the 0 on the stage and then insert 10 keyframes (F6) - in each keyframe delete the 0 in place and replace it with the right number. (Use the < > keys to scroll through the timeline to make sure you didn't miss any number)

The 11th keyframe is blank - this is reserved for Tell Target actions

Now instead of making 6 other movies - go to your symbol Library (Control L) and copy number1 - 6 times and rename each movie number2, number3, .......number7

http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/counter_perp2.gif

Important Note - the first number DOES NOT have a Stop command in the first frame, all other numbers (2 to 7) will. So after duplication go to keyframe 1 of every movie clip and insert a Stop action.



Stage 2 - Setup

Place each movie clip on the stage - since this is a counter number1 goes farthest to the right - number7 will be the first in the chain - farthest to the left

On the stage assign Instance names to each movie by double clicking on each number - Name the first number - number1, the second number - number2, etc. etc.



Stage 3 - Assigning the Tell Target commands

Back to the Library

In the last frame (keyframe11) of each movie assign the following actions

Movie Number 1

Action 1 - Begin Tell Target
(Target name = the next number. So in movie 1 the target is number 2, number 2's target is number 3, and so on)
Action 2 - Go to to Next Frame
End tell target (Will be inserted from Action 1)
Action 3 - Go to and Play

(See screenshot - commands must be in this order)

http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/counter_perp4.gif

Repeat this 5 times EXCEPT Action 3 - in movies 2, 3, 4, 5, and 6 will be Go to and Stop

Movie 7 has a unique set of tell target commands (See Stage 3 part 2)



Stage 3 - Part 2 - Getting the counter to reset

The last movie clip (number 7) has a mess of tell target commands. When it maxes out it has to tell the other numbers to reset to 0 and start over.

Review the following screenshot:

http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/counter_perp5.gif

Note 1 - the first Tell Target resets the first number BUT also tells the sequence to start over - Note Go to and Play

Every other number is set to reset to 0 BUT stop - Note Go to and Stop

http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/counter_perp6.gif

Note 2 - This whole sequence of 6 tell target commands must end with another Go to and Stop after the last End Tell Target (number 6) - (See above screenshot)

After all that - your done

Remember - the more numbers you use - the longer it will take you to assign Tell Target commands BUT it also means that you have more numbers to reset in the very last Tell Target command frame


--------------------------------------------------------------------------------

Troubleshooting

1) Counter numbers go awry or are out of sequence - check a couple of things -

A - that you have the Tell Target sequence in number 1 set to Go To and PLAY and all other set to Go To and STOP (If not all the numbers will count up at the same time)

B - That each instance label is correct and that each previous Tell Target is pointing at the right target - number 2 is pointing for number 3 to advance, number 3 to number 4 etc.

2) Counter doesn't reset - go back and make sure the last instance has all of the proper target commands (see mega screenshot above)



Notes and Other Tweaking

Frame rate - This example is set to the maximum 120 fps - if you use less number you can slow it down

Countdown - You can make the counter start at 9,999,999 and count down to 0 by reversing the above instructions, i.e. start each movie clip at 9 to 0 and reserve the positions of numbers from left to right instead of right to left. BUT you have to adjust the Tell Target commands to go to the right movie and correct frame also. Once you get the concept of the effect then you can make it countdown

------------------------------
------------------------------
so das wars...und damit du es nicht machen musst, hier der download :D
http://www.chemieonline.com/forum/bilder/cyberlink/informatik/counter/counter.zip

hippie
01.05.2001, 21:14
vielen vielen dank, vorallem für die .fla :D
ich denke ich werde damit mal rum experimentieren!

das mit dem english ist kein problem (2. muttersprache !)

woher hast du das tutorial? bei www.flashkit.com und bei www.actionscripts.org habe ich nämlich nichts gefunden!

THX,
hippie

Cyberlink
01.05.2001, 21:31
Originalnachricht erstellt von hippie
vielen vielen dank, vorallem für die .fla :D
ich denke ich werde damit mal rum experimentieren!

das mit dem english ist kein problem (2. muttersprache !)

woher hast du das tutorial? bei www.flashkit.com und bei www.actionscripts.org habe ich nämlich nichts gefunden!

THX,
hippie

1. kein problem...für etwas bin ich doch wohl da :)

2. ah ok..wenns die 2. muttersprache ist sollte es wirklich keine probleme damit geben

3. ..ah empfindliche stelle getroffen: ich sags nicht :) (die seite ist top-secret...verrät jedoch so ziemlich alle flash geheimnisse und scripts) aber definitiv nicht von einer der zwei oben aufgeführten pages :)

wenn du probleme hast schreibs einfach hier rein..ich finde dann schon das passende tutorial für dich :)

hippie
01.05.2001, 22:21
hmm, ein schlauer mensch kann sich selber helfen :D

einfach bei google die worte flash und tutorial eigeben und schon die dritte seite ist ein hit!!

und ich habe schon gedacht, das mit dem student loan dept war ein kleiner scherz von dir...

danke auch für eine neue resourcen seite :)

freu, freu, freu,
hippie

Hubertine
07.12.2004, 21:18
aha

FK
07.12.2004, 21:19
aha
Wie wärs mal mit einem produktiven Beitrag?

Gruß,
Franz

TheoChem
07.12.2004, 22:06
Entschuldigung, die Links (Downloads) funktionieren nicht mehr! Könntest du sie bitte aktualisieren:), damit sie wieder funktionieren?;)

Mit freundlichen Grüßen

TheoChem