How to set dynamic variables in flash (swf) that are passed from javascript?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I'm trying to modify an SWF using a flash decompiler.
I found a SWF that plays a live crypted stream rtmps and I want to use it to embed on my website.
I want to be able to change the url for the stream with javascript:



//FUNCTION IN FLASH

public var serverName:String;

function frame1() : *
{
this.nc = null;
this.serverName = "rtmps://and_the_stream_url";
this.streamName = "A name";
this.stageListener = new Object();
this.videoSizeTimer = Number(0);
this.videoLastW = Number(0);
this.videoLastH = Number(0);
this.fullscreenCapable = false;
this.hardwareScaleCapable = false;
this.debugInterval = Number(0);
this.bufferTime = Number(3);
this.mainInit();
}


So I basicly want to be able to set the serverName variable with something that I pass with javascript when embedding it on my website.



The javascript i´v been looking at is SWFObject.. for example:



var flashvars={};
flashvars.serverName = "my url..";

swfobject.embedSWF("myContent.swf", "my-target-element", "300", "120", "10.0.0", flashvars);


How do I modify the code in flash (swf file) so that it reads the value I´m passing from javascript?



(IF there are other better ways to include a live stream rtmps stream on a website then also let me know :)
I have tried using the flowplayer but I only manage to play rtmp-streams with it)










share|improve this question





























    0















    I'm trying to modify an SWF using a flash decompiler.
    I found a SWF that plays a live crypted stream rtmps and I want to use it to embed on my website.
    I want to be able to change the url for the stream with javascript:



    //FUNCTION IN FLASH

    public var serverName:String;

    function frame1() : *
    {
    this.nc = null;
    this.serverName = "rtmps://and_the_stream_url";
    this.streamName = "A name";
    this.stageListener = new Object();
    this.videoSizeTimer = Number(0);
    this.videoLastW = Number(0);
    this.videoLastH = Number(0);
    this.fullscreenCapable = false;
    this.hardwareScaleCapable = false;
    this.debugInterval = Number(0);
    this.bufferTime = Number(3);
    this.mainInit();
    }


    So I basicly want to be able to set the serverName variable with something that I pass with javascript when embedding it on my website.



    The javascript i´v been looking at is SWFObject.. for example:



    var flashvars={};
    flashvars.serverName = "my url..";

    swfobject.embedSWF("myContent.swf", "my-target-element", "300", "120", "10.0.0", flashvars);


    How do I modify the code in flash (swf file) so that it reads the value I´m passing from javascript?



    (IF there are other better ways to include a live stream rtmps stream on a website then also let me know :)
    I have tried using the flowplayer but I only manage to play rtmp-streams with it)










    share|improve this question

























      0












      0








      0








      I'm trying to modify an SWF using a flash decompiler.
      I found a SWF that plays a live crypted stream rtmps and I want to use it to embed on my website.
      I want to be able to change the url for the stream with javascript:



      //FUNCTION IN FLASH

      public var serverName:String;

      function frame1() : *
      {
      this.nc = null;
      this.serverName = "rtmps://and_the_stream_url";
      this.streamName = "A name";
      this.stageListener = new Object();
      this.videoSizeTimer = Number(0);
      this.videoLastW = Number(0);
      this.videoLastH = Number(0);
      this.fullscreenCapable = false;
      this.hardwareScaleCapable = false;
      this.debugInterval = Number(0);
      this.bufferTime = Number(3);
      this.mainInit();
      }


      So I basicly want to be able to set the serverName variable with something that I pass with javascript when embedding it on my website.



      The javascript i´v been looking at is SWFObject.. for example:



      var flashvars={};
      flashvars.serverName = "my url..";

      swfobject.embedSWF("myContent.swf", "my-target-element", "300", "120", "10.0.0", flashvars);


      How do I modify the code in flash (swf file) so that it reads the value I´m passing from javascript?



      (IF there are other better ways to include a live stream rtmps stream on a website then also let me know :)
      I have tried using the flowplayer but I only manage to play rtmp-streams with it)










      share|improve this question














      I'm trying to modify an SWF using a flash decompiler.
      I found a SWF that plays a live crypted stream rtmps and I want to use it to embed on my website.
      I want to be able to change the url for the stream with javascript:



      //FUNCTION IN FLASH

      public var serverName:String;

      function frame1() : *
      {
      this.nc = null;
      this.serverName = "rtmps://and_the_stream_url";
      this.streamName = "A name";
      this.stageListener = new Object();
      this.videoSizeTimer = Number(0);
      this.videoLastW = Number(0);
      this.videoLastH = Number(0);
      this.fullscreenCapable = false;
      this.hardwareScaleCapable = false;
      this.debugInterval = Number(0);
      this.bufferTime = Number(3);
      this.mainInit();
      }


      So I basicly want to be able to set the serverName variable with something that I pass with javascript when embedding it on my website.



      The javascript i´v been looking at is SWFObject.. for example:



      var flashvars={};
      flashvars.serverName = "my url..";

      swfobject.embedSWF("myContent.swf", "my-target-element", "300", "120", "10.0.0", flashvars);


      How do I modify the code in flash (swf file) so that it reads the value I´m passing from javascript?



      (IF there are other better ways to include a live stream rtmps stream on a website then also let me know :)
      I have tried using the flowplayer but I only manage to play rtmp-streams with it)







      flash video-streaming rtmp swfobject rtmps






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 14:11









      user10695836user10695836

      11




      11
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The flashvars are stored in stage.loaderInfo.parameters. So if you want to loop over all flashvars it would be something like this:



          var flashVars:Object = stage.loaderInfo.parameters;

          for (var key:String in flashVars)
          {
          var value:String = flashVars[key] as String;
          trace(key + ' = ' + value);
          }





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53448233%2fhow-to-set-dynamic-variables-in-flash-swf-that-are-passed-from-javascript%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The flashvars are stored in stage.loaderInfo.parameters. So if you want to loop over all flashvars it would be something like this:



            var flashVars:Object = stage.loaderInfo.parameters;

            for (var key:String in flashVars)
            {
            var value:String = flashVars[key] as String;
            trace(key + ' = ' + value);
            }





            share|improve this answer




























              0














              The flashvars are stored in stage.loaderInfo.parameters. So if you want to loop over all flashvars it would be something like this:



              var flashVars:Object = stage.loaderInfo.parameters;

              for (var key:String in flashVars)
              {
              var value:String = flashVars[key] as String;
              trace(key + ' = ' + value);
              }





              share|improve this answer


























                0












                0








                0







                The flashvars are stored in stage.loaderInfo.parameters. So if you want to loop over all flashvars it would be something like this:



                var flashVars:Object = stage.loaderInfo.parameters;

                for (var key:String in flashVars)
                {
                var value:String = flashVars[key] as String;
                trace(key + ' = ' + value);
                }





                share|improve this answer













                The flashvars are stored in stage.loaderInfo.parameters. So if you want to loop over all flashvars it would be something like this:



                var flashVars:Object = stage.loaderInfo.parameters;

                for (var key:String in flashVars)
                {
                var value:String = flashVars[key] as String;
                trace(key + ' = ' + value);
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 10 '18 at 13:30









                PhilarmonPhilarmon

                1,5811613




                1,5811613
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53448233%2fhow-to-set-dynamic-variables-in-flash-swf-that-are-passed-from-javascript%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini