locked
<asp:Label vrs <input type="text" RRS feed

  • Question

  • Why Will The '<inputtype="text"value="I come from javascript."size="20"onfocus="this.select();"id="data"/>' receive the data but if u switch to data1 will not Why??? please help!

    <

    scripttype="text/javascript">


    functionSaveHiScore() {

                            getFromFlash();

                        }

                   

    </script>


                   

    <scripttype="text/javascript">


                        flashMovie =

    null;

                        $(document).ready(

                           

    function() {

                                flashMovie = $(

    '#gangster1hInteract .movie');

                                flashMovie.flash(

                                    {

                                        swf:

    'flash/gangster1.swf',

                                        width: 770,

    height: 540,

                                        play:

    true,

                                        flashvars: {

                                            hits:

    '0'


                                        },

                                    }

                                );

                            }

                        );

                       

    functionplay() {

                            flashMovie.flash(

                               

    function() {

                                   

    this.Play();

                                }

                            );

                        }

                       

    functionpause() {

                            flashMovie.flash(

                               

    function() {

                                   

    this.StopPlay();

                                }

                            );

                        }

                       

    functionfirstFrame() {

                            flashMovie.flash(

                               

    function() {

                                   

    this.GotoFrame(0);

                                }

                            );

                        }

                       

    functionlastFrame() {

                            flashMovie.flash(

                               

    function() {

                                   

    this.GotoFrame(25);

                                }

                            );

                        }

                       

    functionprevFrame() {

                            flashMovie.flash(

                               

    function() {

                                   

    varcurrentFrame = this.TGetProperty('/', 4),

                                        previousFrame = parseInt(currentFrame) - 2;

                                   

    if(previousFrame < 0) {

                                        previousFrame = 9;

                                    }

                                   

    this.GotoFrame(previousFrame);

                                }

                            );

                        }

                       

    functionnextFrame() {

                            flashMovie.flash(

                               

    function() {

                                   

    varcurrentFrame = this.TGetProperty('/', 4),

                                        nextFrame = parseInt(currentFrame);

                                   

    if(nextFrame >= 25) {

                                        nextFrame = 0;

                                    }

                                   

    this.GotoFrame(nextFrame);

                                }

                            );

                        }

                       

    functionsendToFlash() {

                            flashMovie.flash(

                               

    function() {

                                   

    this.SetVariable('/:hits', document.getElementById('data').value);

                                }

                            );

                        }

                       

    functiongetFromFlash() {

                            flashMovie.flash(

                               

    function() {

                                    data.Text = document.getElementById(

    'data').value = this.GetVariable('/:hits');

                                }

                            );

                        }

                   

    </script>


                   

    <divid="gangster1hInteract">


                       

    <divclass="movie"></div>


     

                   

    </div>


     

     

               

    </LoggedInTemplate>


           

    </asp:LoginView>


           

    <br/>


           

    <br/>


           

    <inputtype="text"value="I come from javascript."size="20"onfocus="this.select();"id="data"/>


           

    <inputtype="button"onclick="getFromFlash();"value="Get from Flash"/>


           

    <br/>


           

    <br/>


           

    <asp:LabelID="data1"runat="server">0</asp:Label>


    ral


    Friday, November 15, 2013 8:38 AM

Answers

  • Hi Bob,

    Please try the ASP.NET forums. Thanks!


    Esther Fan | Visual Studio | If a post answers your question, please mark it as the answer. Thanks!

    • Proposed as answer by Just Karl Friday, November 15, 2013 10:24 PM
    • Marked as answer by Just Karl Friday, November 22, 2013 7:45 PM
    Friday, November 15, 2013 6:52 PM