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 1065121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:45:42+00:00 2026-05-16T19:45:42+00:00

In the following example (yes, I am coding on my timeline while I try

  • 0

In the following example (yes, I am coding on my timeline while I try to work this out – I know, I know) I am loading an SWF in an HTML page and then directing the SWF to get the query parameters from the current URL. The query parameter will contain the source for the video to play.

This seems straight forward to me but I cannot get myURL = urlVars.videoloc; to work. More specifically, urlVars.videoloc seems to be undefined rather than holding the query parameter from the URL. All other variables are correct; both wholeURL and urlVars are defined.

//Initialize Global Event Listener
player.addEventListener(Event.ADDED_TO_STAGE, getPlay, false, 0, true);

//Function to play the video
function getPlay(e:Event):void {
    var wholeURL:String = ExternalInterface.call("window.location.search.toString");
    var urlVars:URLVariables = new URLVariables(wholeURL);
    var myURL:String = urlVars.videoloc; //<--- Trouble, returning 'undefined'
    errorBox.text = "videoloc="+urlVars.videoloc+"\nwholeURL="+wholeURL+"\nurlVars="+urlVars+"\nmyURL="+myURL; //<--- The reason I know it is returning 'undefined'

    if (myURL) {
        player.load(myURL);
        player.play();
    }
}
  • 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-05-16T19:45:42+00:00Added an answer on May 16, 2026 at 7:45 pm

    Ideally you should use a debugger to inspect the makeup of your URLVariables object.

    If you’re unable to do things the easy way, you could do this to trace its contents:

    for (var parameter:String in urlVars) {
        trace(parameter + "=" + urlVars[parameter]);
    }
    

    As you can see, you can step through every parameter inside urlVars using a for in loop.

    I’m guessing videoLoc is your first parameter? Look at the results of this test of mine:

    var address:String = "http://www.google.ca/search?q=test&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a";
    var urlVars:URLVariables = new URLVariables(address);
    
    for (var parameter:String in urlVars) {
        trace(parameter + "=" + urlVars[parameter]);
    }
    

    The output of this is:

    aq=t
    rls=org.mozilla:en-GB:official
    client=firefox-a
    http://www.google.ca/search?q=test
    ie=utf-8
    oe=utf-8

    See what happened to the q parameter? To fix this, use only the text past the ?

    var address:String = "http://www.google.ca/search?q=test&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a";
    var urlVars:URLVariables 
        = new URLVariables(address.substr(address.indexOf('?')+1));
    
    for (var parameter:String in urlVars) {
        trace(parameter + "=" + urlVars[parameter]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With the following c++ example(indention was left out in purpose). if(condA) // if #1
This is my first attempt at C++, following an example to calculate a tip
Suppose the following Employee class (yes I know I shouldn't publicly expose Lists but
While this could possibly result in a simple yes or no answer I'll go
Given the following example: class BaseClass { BaseClass() { }; virtual ~BaseClass() { this->Cleanup();
Why can't we directly use this instead of self in the following example? function
In following example: Line1 <br /> Line2 I'm using <br /> to force Line2
The following example will not compile for me: #include <iostream> #include <functional> #include <string>
Example: Suppose in the following example I want to match strings that do not
I find the following example mildly surprising: >>> class Foo: def blah(self): pass >>>

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.