SWF hangup or Embed?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Loafcitious
    New Member
    • Nov 2008
    • 8

    SWF hangup or Embed?

    Hi Bytes -
    new to the forum here and purty much a AS3 noobie in general.

    I'm working on an mp3 player. Sorta hacking it together from several soucres;
    books, tutorials, google etc..

    Recently, I've had some success including the Visualization class from www.learningact ionscript3.com. It worked great and looked great - that is
    when I executed the program inside the IDE. But, when I got to use the
    preview function I get mixed results; in flash preview the Visualization works
    for a few seconds and then hangs. Leading me to believe I have a problem w/
    the timer. But, then preview in HTML shows no reaction at all when displayed.
    And of course, when I publish - nothing.

    I can not seem to determine if this is a publishing problem and I should use the SWFObject (which I'm sure I should be doing anyways) or it's a problem w/ the code.

    Why would it work on execute inside the IDE and not the preview?

    Any insights would be appreciated.



    tx,
    Andy.
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    Hello Loafcitious,

    I went to the link you provided, and managed to find this .swf file which there seems to be nothing wrong with, all buttons, controls, and everything else is working? And I don't quite get what you're asking except that it's not publishing write? Do any errors or notices pop up?

    joedeene

    Comment

    • Loafcitious
      New Member
      • Nov 2008
      • 8

      #3
      Thanks for taking a loook.
      The swf and the html file are both having the same problem.
      If you'll notice the line in the middle of the player (two close lines
      in are obvious in the swf) it's supposed to jump and move with the
      music. That's the Visualization class. What baffles me is that every
      thing else in the program is working except the visualization.

      Works fine in the IDE upon execution but, hangs or does not work at
      all in previews or publishing.

      Comment

      • joedeene
        Contributor
        • Jul 2008
        • 579

        #4
        Hmm....The two boxes on the bottom right visualize themselves with the music. I notice when I hover my mouse over the lower line of the middle ones it has the hand cursor, which usually signifies a button. Perhaps maybe you accidentally converted the line to a button and not a movie clip and its not functioning properly?

        Also, if you have a main tutorial on just that part, let me have the link, so I can work it out and let you know step from step how I'd do it and see if I get the errors still.

        joedeene

        Comment

        • Loafcitious
          New Member
          • Nov 2008
          • 8

          #5
          Jodeene,

          Thanks for your help. I'm somewhere between what you said about a movie clip and something my friend said about the security sandbox. Perhaps I'm having a "extends MovieClip" vs "..extends Sprite" issue ? hmmm....three things I need to have a good look at.

          The tutorial I've taken the Visualization class from is here:



          The project is in the soundVis folder.

          Andy

          Comment

          • joedeene
            Contributor
            • Jul 2008
            • 579

            #6
            Well try working and troubleshooting each of the three methods you mentioned above and get back to me.

            joedeene

            Comment

            • Loafcitious
              New Member
              • Nov 2008
              • 8

              #7
              Actually, I did find an error w/ the sandbox:

              SecurityError: Error #2122: Security sandbox violation: SoundMixer.comp uteSpectrum: file:///Users/andy/Flash/Actionscript3/dragPlayer/dragPlayer.swf cannot access http://liveaudiomag.co m/audio/mp3/nd/couchdemo/cabinMIX.mp3. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
              at flash.media::So undMixer$/computeSpectrum ()
              at controls::Visua lization/onVisualize()
              at flash.utils::Ti mer/_timerDispatch( )
              at flash.utils::Ti mer/tick()

              Comment

              • joedeene
                Contributor
                • Jul 2008
                • 579

                #8
                Take a look at this link. I think you have to load a policy file for the flash file because the error occurs often when the flash file is opened in a new tab, such as from firefox. So, here's the code to load a policy file:

                Code:
                import flash.system.Security;
                 public function init():void{
                Security.loadPolicyFile(“http://domainname.com/yourpolicy.xml“);
                }
                Here's the documentation for the loadPolicyFile( ) method. Reading this documentation page should get your problem resolved.

                So, I think the way you're accessing your flash file is requiring permissions and when it opens in a new tab it doesn't have permissions as to what to allow to interact.

                joedeene

                Comment

                • Loafcitious
                  New Member
                  • Nov 2008
                  • 8

                  #9
                  Hmm...Thanks so much for telling me about this method.
                  I was just reading about it and thought I had to do it somewhere
                  in the IDE.

                  Anyways, I did get the thing to work. Not sure exactly what I did.
                  Please check to make sure it works for you and it's not just my
                  personal security settings, that would be great.

                  I'm gonna look into including this method in the as file.



                  Andy

                  Comment

                  • joedeene
                    Contributor
                    • Jul 2008
                    • 579

                    #10
                    Hmm...Well ya it works, it's visualizing itself with the music, even when you click mute. Great job. Although, I wonder what fixed it, haha even since you aren't sure either :-P

                    joedeene

                    Comment

                    • Loafcitious
                      New Member
                      • Nov 2008
                      • 8

                      #11
                      Ah ha!
                      I had changed the playback security option in the publishing.
                      I had it set to network and changed it back to local files.

                      I thank you very much again for looking into my problem.
                      Guess it wasn't so much of a newbie issue after all.
                      Maybe I've graduated to novice ? lol hahahahah.

                      maybe not.

                      Super big tx,
                      Andy

                      Comment

                      • Loafcitious
                        New Member
                        • Nov 2008
                        • 8

                        #12
                        hmmm... really? The viz stops when I click mute....interes ting.

                        Comment

                        • joedeene
                          Contributor
                          • Jul 2008
                          • 579

                          #13
                          Originally posted by Loafcitious
                          hmmm... really? The viz stops when I click mute....interes ting.
                          Is this sarcasm?! :-P just messing. Yes, the visualization does stop but then re-continues after you put the mute back off, All is working fine, I was just saying how some visualizations continue to go even when the mute button is on, but it's better when it stops when the mute is on because really that's what it's visualizing, no sound. So, no more bugs. Everything is good :)

                          joedeene

                          Comment

                          • Loafcitious
                            New Member
                            • Nov 2008
                            • 8

                            #14
                            haha...no, sadly it was not sarcasm (how's that?).

                            duh....yeah, just a few minor bugs I have to go back and fix,
                            and a few more features to add. Things I left behind that were
                            minor at the time. I have plans to add the song titles dynamically
                            from the DB. And the song won't "rewind" after it's finished.

                            But, overall I'm really happy. Thanks for your discussions and
                            help! I love this website already...bytes has some great peeps!


                            Andy

                            Comment

                            • joedeene
                              Contributor
                              • Jul 2008
                              • 579

                              #15
                              Originally posted by Loafcitious
                              ...But, overall I'm really happy. Thanks for your discussions and
                              help! I love this website already...bytes has some great peeps!


                              Andy
                              Thanks for the feedback, it's always appreciated to here positive feedback :)

                              I'd also like to send you a friendly reminder to have a thorough look through the Posting Guidelines page

                              Happy delayed welcome to the bytes community haha :-P
                              I'll be looking forward to seeing you often in this forum as well as any other forums you may find useful :D

                              joedeene

                              Comment

                              Working...