10 Replies Latest reply on Dec 11, 2009 1:52 AM by raytron

    Make an object blink or flash?

    raytron Level 1

      Is there a way to make an object blink or start flashing in Catalyst?

        • 1. Re: Make an object blink or flash?
          Tvoliter Adobe Employee

          I've attached an example of a custom component I built that blinks a few times after being clicked.

           

          Here is how I built it:

          1. create some text

          2. convert the text to a custom component

          3. double click the custom component to edit it

          4. duplicate state

          5. edit to the new state to make the "blink" appearance. I drew a yellow rect behind the text

          6. double click the artboard to exit editing the component

           

          Now for the interaction

           

          7. Select the component, go to the Interactions panel, and choose "Add Interaction"

          8. Choose "Play Action Sequence" and click ok. A new action sequence appears in the timeline

          9. With the custom component still selected, go to the Timeline panel and choose Add Action > Set Component state. Do this 5 times

          10. You now have several "Set Component State" action in the timeline. Drag each one to the right to stagger them in time

          11. Select each "Set Component State" action, then go to the Properties inspector and change which state the action goes to. I alternated between state1 and state2 of the custom component.

           

          Play with the attached example to see the finished product.

           

          Ty

          • 2. Re: Make an object blink or flash?
            paulpangrazzi

            That's a clever solution.

            Can the timeline be looped so the animation can be played indefinitely? That would be a useful feature.

            • 3. Re: Make an object blink or flash?
              Tvoliter Adobe Employee

              Catalyst currently does not expose a way to repeat a transition or action sequence. I would expect this will be added in the future.

               

              You can add the "repeatCount" property to the "Parallel" tag to get this functionality if you open the fxp file in Flash Builder

               


              Ty

              1 person found this helpful
              • 4. Re: Make an object blink or flash?
                raytron Level 1

                Thank you, that is very helpful.

                 

                So with that same logic, could you make something appear a few seconds after you click (to simulate a click-and-hold)?

                 

                Also, could you import an animated .gif (that blinks on it's own) and have that become visible when you click?

                • 5. Re: Make an object blink or flash?
                  Tvoliter Adobe Employee

                  Yes, you can drag the "Set Component State" actions in the timeline to the right to add a delay. You can also directly adjust the "start delay" property when you select an effect and look at the Properties panel.

                   

                  Catalyst doesn't support animated gifs, but you can import swf files, so you could make a fancy blinking object in Flash, save it as a swf, and import it into Catalyst. Notice that the "actions" menu in the Timeline panel as commands for controlling swf playback.

                   

                  Ty

                  • 6. Re: Make an object blink or flash?
                    raytron Level 1

                    Hi Ty,

                     

                    If I open my fxp file in Flash Builder, I need to add "repeatCount" to the "Parallel" tag for each Action sequence I want set to repeat?

                     

                    Do I need to type a number of times to repeat, or can I set for infinite repeat?

                     

                    Thanks!

                     

                    Raymond

                    • 7. Re: Make an object blink or flash?
                      Tvoliter Adobe Employee

                      Hi Raymond,

                           Use zero to indicate repeating forever

                       

                      Here is an example where I make a SoundEffect repeat forever:

                       

                      <s:Parallel target="{group1}" repeatCount="0">
                            <mx:SoundEffect source="/assets/media/Clack.mp3" duration="1000"/>
                      </s:Parallel>

                       

                      Ty

                      • 8. Re: Make an object blink or flash?
                        raytron Level 1

                        Thanks Ty

                         

                        But when I try to open the fxp file in Flash Catalyst again it says it has been modified outside of Flash Catalyst and can not be opened.

                         

                        what do you suggest?

                        • 9. Re: Make an object blink or flash?
                          raytron Level 1

                          Basically I just want a SWF file that can be played after I add the repeatCount tags in Flash Builder.

                           

                          Here's an example from my code in Flash Builder.  It's an Action sequence alternating from State1 to State2 for 5-sec. that I want to repeat forever or atleast 2 min.

                           

                          I added the repeatCount tag based on your post, is it in the right place?

                           

                          Thanks!

                           

                          <s:Parallel id="Sequence4">
                             <s:Parallel target="{customcomponent41}" repeatCount="0">
                              <s:SetAction property="currentState" value="State1"/>
                              <s:SetAction property="currentState" startDelay="500" value="State2"/>
                              <s:SetAction property="currentState" startDelay="1000" value="State1"/>
                              <s:SetAction property="currentState" startDelay="1500" value="State2"/>
                              <s:SetAction property="currentState" startDelay="2000" value="State1"/>
                              <s:SetAction property="currentState" startDelay="2500" value="State2"/>
                              <s:SetAction property="currentState" startDelay="3000" value="State1"/>
                              <s:SetAction property="currentState" startDelay="3500" value="State2"/>
                              <s:SetAction property="currentState" startDelay="4000" value="State1"/>
                              <s:SetAction property="currentState" startDelay="4500" value="State2"/>
                              <s:SetAction property="currentState" startDelay="5000" value="State1"/>
                             </s:Parallel>

                          • 10. Re: Make an object blink or flash?
                            raytron Level 1

                            Done and Done.  but the blinking in the SWF file is a little jumpy after adding the repeatCount in Flash Builder.