Skip to main content
Inspiring
February 14, 2022
Answered

isURLInaccesible

  • February 14, 2022
  • 1 reply
  • 417 views

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.

    This topic has been closed for replies.
    Correct answer joaquin5EDD

    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.


    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

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    February 14, 2022

    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#isURLInaccessible

     

    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

     

    Inspiring
    February 14, 2022

    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

    JoãoCésar17023019
    Community Expert
    Community Expert
    February 14, 2022

    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.