Share Posted March 29, 2012 (edited) Hi, I love using Greensock classes. I am currently using LoaderMax for everything! I wanted to know if it was possible to load images from a password protected folder on the server (htaccess protection)? I was researching URLRequestDefaults.setLoginCredentialsForHost(); but it looks as if that is only for AIR and Flash Lite 4. Or is there a way to send variables to a php script using ImageLoader to retrieve the file? Any suggestions? Edited March 29, 2012 by Z0OTY Link to comment Share on other sites More sharing options...
Share Posted March 29, 2012 I'm not aware of a way to have an ImageLoader log in and access password-protected assets, no. You can, however, send data to the server with the request if you want - see the FAQ section of the main LoaderMax page for an example. http://www.greensock.com/loadermax/ Link to comment Share on other sites More sharing options...
Author Share Posted March 29, 2012 Thanks! Link to comment Share on other sites More sharing options...
Author Share Posted May 9, 2012 Playing with the URLRequests and ran into a problem with loading videos: I have a PHP script that accepts the URLVariables from AS3 to pull a file from a folder. The PHP then sets the proper headers for the file (in this case .flv) The VideoLoader DOESN'T load the video and throws an error saying NetStream.Play.StreamNotFound. Everything kind of works with music and photos, they sometimes don't load. Videos do not load at all no matter the type. I can go to the PHP page in browser and the video loads in the browser just fine, but when I try to load it in flash, I get that error. Any ideas? Link to comment Share on other sites More sharing options...
Share Posted May 9, 2012 It sure sounds like the problem is on the server side there. Have you removed VideoLoader from the equation just for testing purposes and used a plain NetStream to load your video? Link to comment Share on other sites More sharing options...
Author Share Posted May 9, 2012 Yup, the video loads fine any other way, even using VideoLoader with a regular string for the URL. It only fails to load once there are variables involved and sending it to a PHP. //shortened AS3 code var request:URLRequest = new URLRequest("http://www.domain.com/my.php"); var data:URLVariables = new URLVariables(); data.one = "1234"; data.two = "video.flv"; request.data = data; request.method = URLRequestMethod.POST; vidLoader = new VideoLoader(request, {name:"video", container:this, autoPlay:true, volume:1, estimatedBytes:750000}); vidLoader.load(); The PHP then locates a the "video.flv" file in folder "1234" and appropriates the headers and reads the file. Works for mp3s and images. Link to comment Share on other sites More sharing options...
Share Posted May 10, 2012 When you say "the video loads fine any other way", are you saying you tried with a regular NetStream apart from VideoLoader, INCLUDING the extra variables? I'm pretty sure you can't do it because of the way NetStream works (it doesn't use a URLRequest - it only accepts a String as a url parameter). Unless my memory is failing me which is entirely possible because it's 3am and I'm pretty sleep-deprived Link to comment Share on other sites More sharing options...
Author Share Posted May 10, 2012 Ahhh I see what you mean. I just tried it. So I guess there is no way around this then huh? Link to comment Share on other sites More sharing options...
Share Posted May 10, 2012 Not that I know of, no. Link to comment Share on other sites More sharing options...
Author Share Posted May 14, 2012 Would DataLoader work in this situation? Link to comment Share on other sites More sharing options...
Share Posted May 14, 2012 You can send data to the server with DataLoader, yes, but that doesn't help with a NetStream that's required for video playback in Flash. Sorry. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now