Hi Pettor
It won't actually solve your particular problem (probably due to
security issues in Flash ?), but...
You should definitely pass the cake path variables to Flash through
HTML/Javascript. For example (in your <object> tag):
<param name="flashVars" value="webroot=<? echo $this->webroot
?>&base=<? echo $this->base ?>" />
(it may depend on the way you embed your Flash app, ie swfobject has a
method addVariable("webroot","<? echo $this->webroot ?>"); )
Like this, you have your paths variables set in your flash app
(_root.webroot and _root.base, probably), without loading anything.
Your way is kind of "dirty", IMHO.
Hope it helps...
+++++++
Clément
On Mon, Aug 18, 2008 at 1:49 PM, Pettor <[EMAIL PROTECTED]> wrote:
>
> Hi, i have a strange problem with a Flash script and CakePHP.
>
> The Flash load images from paths that the database keeps. Because i
> have no clue how to make Flash work togheter with the CakePHP
> framework i wrote a simple read.php file that just connects to the
> database, grabs the paths and prints them. The Flash file use the
> command :"loadVariables("read.php", target_mc);" to fetch the paths
> thats been written by the read.php file into the variable target_mc.
> The read.php file is put in the same folder as the Flash file to make
> it work (the folder is webroot/flash/).
>
> However if i run the Flash file (.swf) by opening it from it's folder
> in webroot/flash/ it works fine. But now i started using CakePHP and
> all this webroot stuff is happening. So when i open the index.php,
> with the flash file attached to it, it doesn't load from the read.php
> because it can't find it. If i in the Flash file use an absolute path
> in the command loadVariables it works fine. The problem is that by
> doing this i have to know the path system on the server the file will
> finally be put on and i can't know that. So i must use a relative path
> and just can't get it to work.
>
> Any tips? Thanks for any help!
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---