Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8600875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:42:53+00:00 2026-06-12T01:42:53+00:00

I’m building a Flex application where users can enter a URL to an image

  • 0

I’m building a Flex application where users can enter a URL to an image on the Internet and then have flash load the image that the URL points to. This works fine for URLs with no special characters (by either setting the source property or calling load() on Image). However, when a URL is submitted that has special characters which have already been escaped, i.e. in most cases simply copied directly from the URL bar in a browser, URLRequest escapes the percent signs again with ‘%25’, which makes the URL invalid and the server returns an error. Pasting the same URL in a browser loads the image just fine though. I’ve tried decodeURI() on the URL, but that ignores a large set of characters, so I tried decodeURIComponent(), and that decodes everything correctly, but when URLRequest goes to re-encode it, it ignores the now-decoded special characters and doesn’t escape them, so in this case the URL is not valid, because it still has unsafe characters in it and fails. So, how can I send URLRequest something with special characters in it (encoded or unencoded) and have it actually work? Really, I wish it didn’t do anything with my URL and let me determine if it’s valid or not, but it’s embedded in the Flash Player globals swc and is therefore the closed-source piece of flash and I can’t see the source code. Any help would be greatly appreciated!

This is basically what I’m doing:

var image:Image = new Image();
image.source = textInput.text;

And the URL I’ve been testing with is from Getty images:

http://cache2.asset-cache.net/gc/sb10064464f-001-dog-looking-up-close-up-gettyimages.jpg?v=1&c=IWSAsset&k=2&d=BRDT%2firX5%2bLh54FjE4ekKh%2bjEirx6jSgMBJOgVxvtKL5ngFuzD9P5u%2bPvlXK4QAMaEHcwY6NrdJUQFip1%2fKXAA%3d%3d

If you step through the code, in the loadContent() function in SWFLoader (which Image extends), after requestedURL is created from a new URLRequest, the url property on the URLRequest object has all percent signs escaped (again) with ‘%25’, producing the following URL (which will return a 500 error from Getty):

http://cache2.asset-cache.net/gc/sb10064464f-001-dog-looking-up-close-up-gettyimages.jpg?v=1&c=IWSAsset&k=2&d=BRDT%252firX5%252bLh54FjE4ekKh%252bjEirx6jSgMBJOgVxvtKL5ngFuzD9P5u%252bPvlXK4QAMaEHcwY6NrdJUQFip1%252fKXAA%253d%253d

Update

  • I forgot to mention that I’m running Flex SDK 4.1, and the Image is mx.controls.Image
  • Based on wvxvw’s suggestion, I tried unescape() with the same result as using decodeURIComponent()
  • I also tried calling encodeURI() on the URL after decoding with decodeURIComponent(), but of course it ignores many of the unsafe characters that are in the decoded URL and doesn’t re-encode them. URLRequest does the same, so the URL called in the end isn’t encoded and therefore fails.
  • Interestingly too, when I tried calling encodeURIComponent() on the URL and re-encoding it before passing it in, URLRequest did not re-encode the percents, presumably because they’re already ‘%25’?
  • In the end, it seems to only look for ‘%’ signs and simply replaces them with ‘%25′ (if they aren’t followed already by ’25’) and then ignores the other unsafe characters. Why would it do that? And why hasn’t anyone else run into this problem before?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:42:54+00:00Added an answer on June 12, 2026 at 1:42 am

    For images loaded from URLs with potentially unsafe characters, you must use Loader or URLLoader and load them manually, which avoids SWFLoader and the OSToPlayerURI() function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.