[Flashcoders] relative path issue

2006-06-08 Thread Michael A. Jordan
Hello all, 

 

Painful discovery.  This technique works great on a PC, not on a
MAC.  

 

Any ideas?

 

-- Michael

 

 

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] relative path issue

2006-06-08 Thread janosch

I don't know why, but this email cam to me like this:

Hello all, 
Painful discovery.  This technique works great on a PC, not on a
MAC.  
Any ideas?

-- Michael




Michael A. Jordan schrieb:

Hello all, 




   Painful discovery.  This technique works great on a PC, not on a
MAC.  




   Any ideas?



-- Michael





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] relative path issue

2006-05-30 Thread Michael A. Jordan
To all those trying to test loading of data from relative paths locally,
here's a little secret I've learned.

At least with Flash 8, the Flash IDE stores the path of the last file opened
and treats it like the server root. 

Let's say you have a local environment with two main directories, a source
directory and a deploy directory. 
- source/
main.fla
 - subdirectory/
secondary.fla
- deploy/
main.swf
- subdirectory/
secondary.swf
- xml/
data.xml

The source file source/main.fla publishes to deploy/main.swf.  The source
file source/subdirectory/secondary.fla publishes to
deploy/subdirectory/secondary.swf.  

Both main.swf and secondary.swf load an xml file from the path
/xml/data.xml.  

If you open the file secondary.fla within the Flash IDE and test the movie
using CTRL+ENTER, the published file secondary.swf will not be able to
locate the file /xml/data.xml, because the FlashPlayer will search from the
path source/subdirectory/.  

However, if you then open deploy/main.swf from within the Flash IDE, the
opened file main.swf will be able to locate the file /xml/data.xml, because
the FlashPlayer will search from the path deploy/, treating it as if it were
a server root.  

Now if you switch tabs back to secondary.fla and test again using
CTRL+ENTER, the published file secondary.swf will be able to locate the file
/xml/data.xml, because the FlashPlayer will search from the path of the last
file opened, deploy/.

I hope someone finds this useful.  It's been a real timesaver for me.  I
used to rely on branching for System.capabilities.playerType, but with more
complex projects and directory structures it became unmanageable.

Cheers,
   Michael



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] relative path issue

2006-04-06 Thread elr


Hi all,

As many before me, I can't get rid of a Error opening URL file: message...
I set up a small swf that locally access to an xml file ( these two 
files are in the same dirB)


Now using a loadMovie command,I try to load this small swf module 
into a main one that is located in a parent dirA

//dirA/main.swf
//dirA/dirB/child.swf
//dirA/dirB/child.xml


I don't want any absolute path into child.swf  neither to relocate 
child.xml into dirA.

Is there a clean (easy?) way to make child module recover access to its xml ?

Thank you !

Eric

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] relative path issue

2006-04-06 Thread Manuel Saint-Victor
did you try the path ./dirB/child.xml?


On 4/6/06, elr [EMAIL PROTECTED] wrote:


 Hi all,

 As many before me, I can't get rid of a Error opening URL file:
 message...
 I set up a small swf that locally access to an xml file ( these two
 files are in the same dirB)

 Now using a loadMovie command,I try to load this small swf module
 into a main one that is located in a parent dirA
 //dirA/main.swf
 //dirA/dirB/child.swf
 //dirA/dirB/child.xml


 I don't want any absolute path into child.swf  neither to relocate
 child.xml into dirA.
 Is there a clean (easy?) way to make child module recover access to its
 xml ?

 Thank you !

 Eric

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] relative path issue

2006-04-06 Thread Éric Thibault
I think he says that when testing the child.swf there is no error but 
when loaded inside the parent SWF the error shows...


The only way I manage to come over this is to test inside the child.swf 
if it is embeded inside another swf... if so, I modify my path to the xml.


You can also put inside the parent SWF a variable telling where is the 
XML folder... and if the child.swf can read that parent variable than 
set the path accordingly.


//if you have _lockroot inside your child.swf... check the synthaxe 
before use ;-) ...


var AppendPathFolder:String = ;

if(_root._parent.PathToFolderXML != undefined)
   AppendPathFolder = _root._parent.PathToFolderXML;

MyXML.load(AppendPathFolder+ /child.xml);

A+

Éric.

Manuel Saint-Victor wrote:


did you try the path ./dirB/child.xml?


On 4/6/06, elr [EMAIL PROTECTED] wrote:
 


Hi all,

As many before me, I can't get rid of a Error opening URL file:
message...
I set up a small swf that locally access to an xml file ( these two
files are in the same dirB)

Now using a loadMovie command,I try to load this small swf module
into a main one that is located in a parent dirA
//dirA/main.swf
//dirA/dirB/child.swf
//dirA/dirB/child.xml


I don't want any absolute path into child.swf  neither to relocate
child.xml into dirA.
Is there a clean (easy?) way to make child module recover access to its
xml ?

Thank you !

Eric

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

   


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] relative path issue

2006-04-06 Thread Éric Thibault

OUPS...

Change this line : MyXML.load(AppendPathFolder+ /child.xml);

to this : MyXML.load(AppendPathFolder+ child.xml);

and put the / inside the parent's PathToFolderXML variable!

Éric Thibault wrote:

I think he says that when testing the child.swf there is no error but 
when loaded inside the parent SWF the error shows...


The only way I manage to come over this is to test inside the 
child.swf if it is embeded inside another swf... if so, I modify my 
path to the xml.


You can also put inside the parent SWF a variable telling where is the 
XML folder... and if the child.swf can read that parent variable 
than set the path accordingly.


//if you have _lockroot inside your child.swf... check the synthaxe 
before use ;-) ...


var AppendPathFolder:String = ;

if(_root._parent.PathToFolderXML != undefined)
   AppendPathFolder = _root._parent.PathToFolderXML;

MyXML.load(AppendPathFolder+ /child.xml);

A+

Éric.

Manuel Saint-Victor wrote:


did you try the path ./dirB/child.xml?


On 4/6/06, elr [EMAIL PROTECTED] wrote:
 


Hi all,

As many before me, I can't get rid of a Error opening URL file:
message...
I set up a small swf that locally access to an xml file ( these two
files are in the same dirB)

Now using a loadMovie command,I try to load this small swf module
into a main one that is located in a parent dirA
//dirA/main.swf
//dirA/dirB/child.swf
//dirA/dirB/child.xml


I don't want any absolute path into child.swf  neither to relocate
child.xml into dirA.
Is there a clean (easy?) way to make child module recover access to its
xml ?

Thank you !

Eric

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

  


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] relative path issue

2006-04-06 Thread elr
yes, Manuel,  ./dirB/./dirB/child.xml works but it prevents any 
relocation of files without code update. :(
Can't we imagine a kind of  environment variable returning swf's 
path? A kind of ?



Eric


At 2006-04-06   10:08, you wrote:

did you try the path ./dirB/child.xml?


On 4/6/06, elr [EMAIL PROTECTED] wrote:


 Hi all,

 As many before me, I can't get rid of a Error opening URL file:
 message...
 I set up a small swf that locally access to an xml file ( these two
 files are in the same dirB)

 Now using a loadMovie command,I try to load this small swf module
 into a main one that is located in a parent dirA
 //dirA/main.swf
 //dirA/dirB/child.swf
 //dirA/dirB/child.xml


 I don't want any absolute path into child.swf  neither to relocate
 child.xml into dirA.
 Is there a clean (easy?) way to make child module recover access to its
 xml ?

 Thank you !

 Eric

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] relative path issue

2006-04-06 Thread Adrian Lynch
You can create your own variable based on:

System.capabilities.playerType

It will be External when in the IDE. Other values include ActiveX,
PlugIn and one other which I can't remember.

So something like:

if (System.capabilities.playerType == External) {
path = ../;
} else {
path = ../../../../../../../;
}

Adrian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of elr
Sent: 06 April 2006 15:28
To: Flashcoders mailing list
Subject: Re: [Flashcoders] relative path issue


yes, Manuel,  ./dirB/./dirB/child.xml works but it prevents any
relocation of files without code update. :(
Can't we imagine a kind of  environment variable returning swf's
path? A kind of ?


Eric


At 2006-04-06   10:08, you wrote:
did you try the path ./dirB/child.xml?


On 4/6/06, elr [EMAIL PROTECTED] wrote:
 
 
  Hi all,
 
  As many before me, I can't get rid of a Error opening URL file:
  message...
  I set up a small swf that locally access to an xml file ( these two
  files are in the same dirB)
 
  Now using a loadMovie command,I try to load this small swf module
  into a main one that is located in a parent dirA
  //dirA/main.swf
  //dirA/dirB/child.swf
  //dirA/dirB/child.xml
 
 
  I don't want any absolute path into child.swf  neither to relocate
  child.xml into dirA.
  Is there a clean (easy?) way to make child module recover access to its
  xml ?
 
  Thank you !
 
  Eric
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] relative path issue

2006-04-06 Thread elr

Yes, I finally see this approach:

1 - as you suggest, make child.swf detect its running mode (embedded or not)
2 - pass relative path to main.swf through a flashvar

I 'll have a look at System.capabilities lib.

Thx to all of you for your fast answers ;-)

Eric



At 2006-04-06   10:23, you wrote:
I think he says that when testing the child.swf 
there is no error but when loaded inside the parent SWF the error shows...


The only way I manage to come over this is to 
test inside the child.swf if it is embeded 
inside another swf... if so, I modify my path to the xml.


You can also put inside the parent SWF a 
variable telling where is the XML folder... and 
if the child.swf can read that parent variable than set the path accordingly.


//if you have _lockroot inside your child.swf... 
check the synthaxe before use ;-) ...


var AppendPathFolder:String = ;

if(_root._parent.PathToFolderXML != undefined)
   AppendPathFolder = _root._parent.PathToFolderXML;

MyXML.load(AppendPathFolder+ /child.xml);

A+

Éric.

Manuel Saint-Victor wrote:


did you try the path ./dirB/child.xml?


On 4/6/06, elr [EMAIL PROTECTED] wrote:



Hi all,

As many before me, I can't get rid of a Error opening URL file:
message...
I set up a small swf that locally access to an xml file ( these two
files are in the same dirB)

Now using a loadMovie command,I try to load this small swf module
into a main one that is located in a parent dirA
//dirA/main.swf
//dirA/dirB/child.swf
//dirA/dirB/child.xml


I don't want any absolute path into child.swf  neither to relocate
child.xml into dirA.
Is there a clean (easy?) way to make child module recover access to its
xml ?

Thank you !

Eric

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com