Locking path like locking root

lets say i have a file system like this:

Main.swf
/myfolder/Sub.swf
/myfolder/Sub.php

what if i need the Sub.swf to always find the native php file eather it gets loaded into main.swf or gets played from local folder and i can’t use full paths. is it possible to load
Sub.swf into Main.swf and make sure that Sub.swf still thinks /myfolder/ as home?