Skip to main content
Participant
December 11, 2013
Answered

Load AS3 from web URL?

  • December 11, 2013
  • 2 replies
  • 976 views

I am making an Android app for my YouTube channel. I want to make it so that it can play my most recent video as well as other ones. I can embed the YouTube video into the SWF using AS3 but the problem is that I would have to update the app every time I come out with a video so that it shows it in the app.

Is there any way, using AS3 only, that I could make the video URL that I have specified in the code load from my website? I need a way to make it so that I upload a file to my website (Example: http://www.mydomain.com/URL.txt) and then my app reads the file to get the YouTube URL that it is going to embed. This way all I have to do is edit the file on my website instead of pushing an app update every time.

If there are any ways to do this or similar, help! Looking forward to your responses!

This topic has been closed for replies.
Correct answer kglad

you can't "load" an as3 file.  the code in that file must be compiled so you can't "load" code dynamically.

however, you can load code in a compiled swf, in effect, loading code dynamically.

2 replies

Known Participant
December 25, 2013

Hey xp3 can you send me your code as an example.I am trying to play a video from the web but it is not working.

thank you

kglad
Community Expert
Community Expert
December 11, 2013

you can use stagewebview to load a url (like your youtube video) into your android app.

loading a text or xml file that contains the url can be done using the urlloader class.

xp3tp85Author
Participant
December 24, 2013

What if I wanted it to load the Actionscript from a .as3 file on my site?

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
December 25, 2013

you can't "load" an as3 file.  the code in that file must be compiled so you can't "load" code dynamically.

however, you can load code in a compiled swf, in effect, loading code dynamically.