isURLInaccesible

Contributor ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Hello. I am trying to access the isURLInaccessible property of the Sound class. I get the error:

TypeError: Error #1010: A term is undefined and has no properties.

 

my code is very simple to access:

trace(mySound.isURLInaccessible);

 

I've looked at the flash as3 reference and I don't see anything that can help me, and I can't find any help on the internet either.

 

Thanks for the help.

Views

65

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Feb 15, 2022 Feb 15, 2022
I've already got isURLInaccessible to work. It works with the variable://it works ok! trace(sound0["isURLInaccessible"]); //not work with the array variable: trace(this[soundA[0]]["isURLInaccessible"]); it's the same var, but the array var don't works!.Thanks for the help

Likes

Translate

Translate
Adobe Community Professional ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Hi.

 

It works for me. But there's a note in the official documentation warning about some restrictions:

 

Note: The isURLInaccessible property was added for Flash Player 10.1 and AIR 2.0. However, this property is made available to SWF files of all versions when the Flash runtime supports it. So, using some authoring tools in "strict mode" causes a compilation error. To work around the error use the indirect syntax mySound["isURLInaccessible"], or disable strict mode. If you are using Flash Professional CS5 or Flex SDK 4.1, you can use and compile this API for runtimes released before Flash Player 10.1 and AIR 2.

https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#isURLInac...

 

So you may need to disable strict mode - which I don't recommend - or use indirect syntax / bracket notation: mySound["isURLInaccessible"].

 

I hope it helps.

 

Regards,

JC

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

I have used

trace(this[soundZ[0]]["isURLInaccessible"]);

and I get the same error 1010.

 

I have also disabled strict mode and it doesn't work either.

 

I had already read that note but now I read it with more attention... perhaps I don't understand this sentence well...:

"If you are using Flash Professional CS5 or Flex SDK 4.1, you can use and compile this API for runtimes released before Flash Player 10.1 and AIR 2."

Sometimes I get lost with the names... runtime, sdk, flash, flex, air... a mess!
the phrase means that with the program that I use (animate version 22.0.3) isURLInaccessible will not work for me and that I must use a version prior to Flash Player 10.1?

 

Thanks for the help...

joaquin

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

If you run...

trace(this[soundZ[0]]);

... What do you get?

 

And you can certainly use Animate. Those compatibility notices made more sense years ago when this and other features were still new and Flash Player and Air were still in older versions.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

If you run...

trace(this[soundZ[0]]);

... What do you get?

 

undefined.

this[soundZ[0]]. contains a sound downloaded from my drive. when I remove the sound on my drive, the compiler gives an error and also outputs undefined....

I wanted to use isURLInaccessible so that, once the different sounds were loaded, I would know if any of them were not loaded correctly due to any error. IOerrorevent doesn't work properly on load, that's why I try to use this trick. Any ideas?

Also any ideas why isURLInaccessible doesn't work?

Thank you!!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

I see.

 

If this[soundZ[0]] is undefined, then you cannot access any property or method from it.

 

You have to first make sure that you have a valid sound instance.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

LATEST

I've already got isURLInaccessible to work. It works with the variable:

//it works ok!
trace(sound0["isURLInaccessible"]);

//not work with the array variable:
trace(this[soundA[0]]["isURLInaccessible"]);


it's the same var, but the array var don't works!.

Thanks for the help

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines