Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flash General Questions > Flash 9 General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-03-2007, 03:28 AM   #1
3pepe3
;)
 
3pepe3's Avatar
 
Join Date: Aug 2006
Location: In transit--- Still bored
Posts: 1,705
Question relative path of files on server?????

Hello world.
This question I don’t know if must be in actionscript2 or server side-scripting. But I feel that this is the correct section.
The problem is: I have a main.swf that loads askphp.swf and this askphp sendandload answer.php.
Folder structure:
  • page/ (folder)
  • main.html
  • main.swf
  • swfs/ (folder)
  1. otherfolder/
  • askphp.swf
  • phps/ (folder)
  • answer.php
but I can’t find the way to get answer… in a textfield I’m getting "Error connecting to server."
askphp.fla
ActionScript Code:
//simplified version var answer_lv:LoadVars = new LoadVars(); answer_lv.onLoad = function(success:Boolean) {     if (success) {            t.text = answer_lv.info ;           } else {         t.text = "Error connecting to server.";     } }; var send_lv:LoadVars = new LoadVars(); send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
The answer.php:
PHP Code:
<?php
//simplified version
echo "&info=hello world&";
?>
What I think is that the problem is referencing to the php file.
ActionScript Code:
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST"); //but I think that main.swf is the root so the php file is phps/answer.php //also another option was that php must be relative to the askphp.swf so I changed the path to: //send_lv.sendAndLoad("../../phps/answer.php",answer_lv,"POST");// but this method was just working outside the main.swf
Any advice???
__________________
http://www.pepemagana.com

Last edited by 3pepe3; 08-03-2007 at 03:40 AM..
3pepe3 is offline   Reply With Quote
Old 08-03-2007, 04:17 AM   #2
3pepe3
;)
 
3pepe3's Avatar
 
Join Date: Aug 2006
Location: In transit--- Still bored
Posts: 1,705
Default Fixed

Well now I’m confused… I don’t know what was happening but now al is working
And what I have learned is that the SWFs loaded into another SWF will need to use the proper path for all the external information that they will need to load. The proper path will be relative to the original (main.swf) SWF and not the relative path of the loaded SWF.
in this case 'phps/answer.php' was correct
Hope this is helpful.
__________________
http://www.pepemagana.com
3pepe3 is offline   Reply With Quote
Old 08-03-2007, 08:46 AM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

I think it is more correct to say that the path is relative to the main.html which embeds your main.swf file...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 08-03-2007, 09:43 AM   #4
3pepe3
;)
 
3pepe3's Avatar
 
Join Date: Aug 2006
Location: In transit--- Still bored
Posts: 1,705
Default

you are right... Thanks for the correction (also it's more clear).
__________________
http://www.pepemagana.com
3pepe3 is offline   Reply With Quote
Old 08-03-2007, 10:10 AM   #5
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

My pleasure...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 08-07-2007, 01:45 PM   #6
3pepe3
;)
 
3pepe3's Avatar
 
Join Date: Aug 2006
Location: In transit--- Still bored
Posts: 1,705
Default

path from php:
http://www.actionscript.org/forums/s...d=1#post639756
__________________
http://www.pepemagana.com
3pepe3 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why everyone hates (or should hate!) mircosoft stealthelephant General Chat 102 11-28-2008 10:02 PM
relative path to SWF in loadMovie() is relative to HTML page not the parent SWF danielito540@hotmail.com ActionScript 2.0 11 08-21-2008 01:49 PM
.sol files in a specified path manikk ActionScript 2.0 0 06-18-2007 08:09 AM
Dynamically change base (relative) path antiflash ActionScript 2.0 2 09-27-2005 12:21 AM
relative path names, classes, screens atomicjoe ActionScript 2.0 0 07-20-2004 05:00 PM


All times are GMT. The time now is 07:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.