5 Replies Latest reply on May 30, 2013 8:11 AM by JohnJeff56

    Can I use single words in a paragraph to show other elements on the stage?

    JohnJeff56

      I want to put a paragraph on the stage. The paragraph would look like this:

       

          " Yada yada yada... so either click here to read Note1, or click here to read Note2. "

       

      As you might guess, I want the user to be able to click the underlined words in the paragraph - and have the appropriate notes appear.

       

      Is it possible to do this kind of thing in Edge Animate?

       

      TIA,

       

      Jeff

        • 1. Re: Can I use single words in a paragraph to show other elements on the stage?
          PsychedelicPupil

          Hi Jeff,

           

          The way I would do that is by showing and hiding elements. You would create "Note1" on the stage of your current project. If "Note1" is an animation then you will convert it to a symbol called "Note1" or leave it as an element called "Note1" if it's static. Somewhere in your "Note1" you might want to include an "X" or "close" to hide the note when it's not needed. In the actions for the "X" or "close" you would choose "click" then hide element or type in "sym.$("Note1").hide();"

           

          Leave it set as "always on" to create and position it, then set it to "off". Then in your sentence "Yada yada yada... so either click here to read Note1, or click here to read Note2." You would type in the text "here" seperately than the rest of the sentence anywhere you want a note to pop up. You can then choose the actions of your first "here" (lets call it "here1") In the actions choose "click", then show element or type in "sym.$("Note1").show();" Note1 can then be hidden by clicking on the "X" or "close" that's a part of "Note1"

           

          This will work same for any "Notes" you'd like to do.

           

          You can also do this with mouseover and mouseout by using the same show and hide commands for those actions. Then "note1" will only show when mouse is over "here1"

           

          Hope that helps,

          Brian

          • 2. Re: Can I use single words in a paragraph to show other elements on the stage?
            PsychedelicPupil Level 1

            Here's a quick sample.

             

            I also forgot to mention that you will probably want to choose something other than the default cursor for your clickable text.

             

            http://www.mediafire.com/download/vp4xzb8m8yy5vb2/Note1.7z

            • 3. Re: Can I use single words in a paragraph to show other elements on the stage?
              JohnJeff56 Level 1

              Thanks Brian,

               

               

              I'm downloading something to unzip your example. In the meantime, I can say

              that I do NOT want to add the clickable words as separate text elements on

              the stage. I want them to be part of a single paragraph.

               

               

              For instance, I can create the paragraph content by putting the following

              in the compositionReady:

               

              < sym.$('Note_wwjd').html("<p>Click <span onclick='alert(&quot;Hello World&quot;);' style='color:blue; text-decoration: underline;'>here.</span></p>"); >

               


              What I'm after is the Edge Animate code to replace the alert function i.e.
              the bit that reads <  onclick='alert("Hello World");' > ... and

              instead show another object on the stage.

               

               

              Do you know what the Edge Animate code for this would be?

               

               

              Regards,

               

               

              Jeff.

               

               

              On Wed, May 29, 2013 at 2:33 PM, PsychedelicPupil

              • 4. Re: Can I use single words in a paragraph to show other elements on the stage?
                Zaxist Level 4

                Dear Jeff

                 

                i did some try and find a way for you to do it

                 

                sym.$("Text").html("<a id='btn1' >here</a>")

                 

                $("#btn1").click(function(){

                sym.$("Note1").show();

                });

                 

                Zaxist

                • 5. Re: Can I use single words in a paragraph to show other elements on the stage?
                  JohnJeff56 Level 1

                  FANTASTIC Zaxist!

                  sym.$("Text").html("<a id='btn1' >here</a>")

                   

                  $("#btn1").click(function(){

                  sym.$("Note1").show();

                  });

                   

                   

                  That works perfectly!

                   

                  I'm wondering: Would you have time to comment your code snippet...? I mean explain the syntax, and maybe point me to the relevant secion of the API, or other learning resources? (This is, hands down, the BEST forum I've ever been on. But I want to do a better job of learning to do things on my own, so I don't have to bug people with too many questions!)

                   

                  Anyway, thanks again. this opens up a bunch of doors for me.

                   

                  Jeff.