Sound object in actionscript 3 - actionscript-3

Simply I am trying to load a sound using an URL. But Its not loading.... So I am trying debug this. But I am getting a different thing. For that sound object I am getting
bytesLoaded value is 15903
but the
bytesToal value is 0
Is it possible to come like this???

I think your sound URL may be wrong. Where you are getting this URL? Is it from your local or from your db? Please check your URL... sound is not available, but you are trying to load means it will come like this.
I don't know its correct or not... But try to confirm that URL....

Related

Html Chat Or Something With Parameters

Well, I almost don't know anything about this language, so I need help!
I need codes/scripts that I can paste to my website, or copy the files on the server... then make that work.
I used to copy random ones but nothing worked.
What exactly I need:
-A chat that appears on the page
-That chat should with with URL parameters, like: www.site.com/message="Hello", so that message appears on the page
-All messages should be saved in a file on server, for example "history.txt", and that history should load by loading the page...
Is that all simple? Possible?
Thanks if anyone get me an answer(s)!
You need to use PHP to do this. If you use the GET method, parameters can be passed through the url, and it's very easy to read and write files. Where are you coding at the moment?

Is there any way to handle new SWF loaded?

i would like to know if there is a way to handle new SWF or class loaded in the AVM..
expecially in system domain.
What i was thinking to do is like call
ApplicationDomain.currentDomain.parentDomain.getQualifiedDefinitionNames();
every second and check for new classes(comparing last call result with new one). I don't like this way because it's a waste of performances and i prefer detect SWF instead of classes.
Hoping for some response, regards

Articulate: Unsafe JavaScript attempt to access frame with URL Error

I am trying to play story_html5.html video from Amazon Cloud fount in a IFrame, "story.html" is working fine in Iframe, but when use story_html5.html, it gives error.
Unsafe JavaScript attempt to access frame with URL "URL1" from frame with URL "URL2". Domains, protocols and ports must match.
Please let me know about the solution.
Thanks,
Laxmilal Menaria
I believe the html5 version of the file may be called once the code determines it's needed. Based on this, your personal code may look like it's trying to hijack the process and causing the exception. W/out the exact code you're working with though, it's hard to say. This is just based on my pulling apart some of the files a while back.

Using RequestURL to get to a different folder

I am using AS3 to make a game. I use RequestURL( filename ) to obtain the music I want to play. However, this means the music file has to be in the same folder as the .fla file. How can I use it to get a music file from a different folder? I don't really like having to leave my music outside of a Music folder or properly organised somehow....
EDIT: Should have mentioned this earlier. I tried to use simply something such as "whatever/filename", but I got this security error:
SecurityError: Error #2000: No active security context.
Why?
Have you tried using the flash.media.Sound.load() method yet?
//Make a new sound object
var s:Sound = new Sound();
//Load it
s.load(new URLRequest("someDifferentMusicFolder/loop.mp3"));
//Play it
s.play()
If you are loading it via another method, such as URLLoader + URLRequest, please post your code and we should be able to help a little better.
Generally speaking though URLRequests should allow you to specify different folders, so your problem may not be in the methodology you are using but may be in your implementation? Perhaps you are getting a security error? Whatever it may be, if you post your code we can help you narrow it down.

Is it possible to access raw file data as FileReference.load() loads it in memory?

I think it's not, but maybe I'm wrong. Anyone?
UPDATE:
It's not.
i think you can, at least there is nothing in the docs that states otherwise. try adding a ProgressEvent on the FileReference object to read it's data (ByteArray) property after calling load().
however, if you're loading a file with URLLoader, a URLLoader's data property is only populated once the load operation has completed.
[EDIT]
so it's, after all, not possible to access live fileReference data while loading. the docs should explicitly state that it's not possible since it's a valid request.
however, after a some stumbling thru the docs i realized that you can do this by using the URLStream class, which provides methods to read data while it's loading - it's designed to do exactly what you are looking for.
the only catch, in this case, is that URLStream requires a full URL path (URLRequest object), which is not obtainable with FileReference for security reasons - it's only possible to get the name of a selected file, not the complete path. obtaining a local file path in AIR is very easy, but since you want your application to be browser-resistant i'm not quite sure how you'll be able to access file paths from the user's computer - unless they type in the file path, but requiring your users to do so would seriously degrade UX.
It is not possible currently...