A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Load .txt file problem

Hybrid View

  1. #1
    Robert (www.oldmanmovies.com)
    Join Date
    Jan 2006
    Location
    Washtington State
    Posts
    13

    Question Load .txt file problem

    Hey I am using the load command to load content from a .txt file on my server. I have it all working just find when I preview the swf file in flash and when I view the .swf in my web browser from my server. The problem when I view the .swf file on my php page (home.php) I only get undefined variables, it seems to not be able to connect to the .txt files only when I am viewing it on my php page. Again if I view the .swf file on my server using my web browser it works fine. What could be the problem?

    Using Flash CS4
    Actionscript 2
    Dreamweaver CS4
    Google Chrome and Opera

    Actionscript Code:
    //Get Title
    firstTitle = new LoadVars();
    firstTitle.onLoad = function(){
       story_title.text = this.content;
    };
    firstTitle.load("http://files.psu-tv.com/textfiles/homepanel/title5.txt");

    //Get Text
    secDescription = new LoadVars();
    secDescription.onLoad = function(){
       description.text = this.content;
    };
    secDescription.load("http://files.psu-tv.com/textfiles/homepanel/description5.txt");

    to view the website: http://www.psu-tv.com/home.php
    to view the swf: http://files.psu-tv.com/flash/homepanel.swf
    Robert Pallister

  2. #2
    Robert (www.oldmanmovies.com)
    Join Date
    Jan 2006
    Location
    Washtington State
    Posts
    13

    Angry Here is the code for the swf on the php page

    This is the code from home.php that displays the swf file.

    PHP Code:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000" height="500" id="FlashID2" title="">
              <
    param name="movie" value="flash/homepanel.swf" />
              <
    param name="quality" value="high" />
              <
    param name="wmode" value="opaque" />
              <
    param name="swfversion" value="6.0.65.0" />
              <!-- 
    This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash PlayerDelete it if you don’t want users to see the prompt. -->
              <
    param name="expressinstall" value="Scripts/expressInstall.swf" />
              <!-- 
    Next object tag is for non-IE browsersSo hide it from IE using IECC. -->
              <!--[if !
    IE]>-->
              <
    object type="application/x-shockwave-flash" data="flash/homepanel.swf" width="1000" height="500">
                <!--<![endif]-->
                <
    param name="quality" value="high" />
                <
    param name="wmode" value="opaque" />
                <
    param name="swfversion" value="6.0.65.0" />
                <
    param name="expressinstall" value="Scripts/expressInstall.swf" />
                <!-- 
    The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                <
    div>
                  <
    h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                  <
    p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                </
    div>
                <!--[if !
    IE]>-->
              </
    object>
              <!--<![endif]-->
            </
    object
    Robert Pallister

  3. #3
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Try

    Actionscript Code:
    //Get Title
    firstTitle = new LoadVars();
    firstTitle.onLoad = function(){
       story_title.text = this.content;
    };
    firstTitle.load("http://localhost/textfiles/homepanel/title5.txt");

    //Get Text
    secDescription = new LoadVars();
    secDescription.onLoad = function(){
       description.text = this.content;
    };
    secDescription.load("http://localhost/textfiles/homepanel/description5.txt");



    marlopax

  4. #4
    Robert (www.oldmanmovies.com)
    Join Date
    Jan 2006
    Location
    Washtington State
    Posts
    13
    I tired that but it would not work, I also tried loading the data via XML and I ran into the same problem, it would load when I view the .swf on the server but when I view it on the php page it will not load. Any suggestions, maybe some security setting I am not aware of. I have the xml file in the same location as the swf file. I really need to get this problem fixed.
    Robert Pallister

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center