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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:22:40+00:00 2026-05-27T18:22:40+00:00

Several months ago for a project at work i developed a video player using

  • 0

Several months ago for a project at work i developed a video player using flash, external interface and swfobject.js. I used external interface to facilitate communication between javascript and actionscript. This works great. Currently I am working on an extension to this that requires me to extrapolate logic from what i already written. I am using the same swf file in both applications, but in the extension i can’t get the flash object to recognize my calls. Since i am using the same swf object i know that my problem is in the javascript, i just don’t know where. I am using the JQuery Library. Without further adieu here’s my code.

At the bottom of my js file i have the following:

$(function(){
     //the video player shouldn't be built until the user presses the div with 'video-btn' class
    $('.video-btn').click(function(){
         var videoplayer = new VideoPlayer();
         videoplayer.addVideoPlayer();
         //external interface function
         videoplayer.player.loadVideo();
    });
});

Here’s the definition for VideoPlayer.addVideoPlayer() and it’s relevant helper functions:

//inside of VideoPlayer object definition
this.addVideoPlayer = function(){
     var that = this;
     $('body').append('<div id="no-flash"></div>');

     //uses swfobject.js to replace the div i just appended with the flash object
     //This works fine.  the flash object replaces the div as intended
     that.embedFlashObject();
     //that.player is (supposed to be) a reference to flash object
     that.player = that.getFlashObject();
};

this.embedFlashObject = function(){
     var that = this;

     //set up all the variables to pass to swfobject.embedSWF

     //this method removes my div and replaces it with an object element that contains the swf file
     //the object tag gets an id which is specified.  Let's assume it's 'vp'
     swfobject.embedSWF(swfFile, 'no-flash', width, hieght, '9.0.0', ... );
};

this.getFlashObject = function(){
     var that = this;

     //this method returns the flash object to make external interface calls on
     //this the method prescribed by swfobject api  
     var videoObj = swfobject.getObjectById('vp');
     if(typeOf videoObj == 'undefined')
     {
          //check if useragent string is IE
          var isIE = navigator.userAgent.match(/MSIE/i);
          videoObj = isIE ? window['vp'] : document['vp'];
     }
     return videoObj;
};

In my $(function(){..}); block, when the command ‘videoplayer.player.loadMedia();‘ I get an error that reads

.loadMedia is not a function.

In the previous version of this project (in which i use the exact same swf file) i do not get this error.

I don’t think i am missing any severe logical errors, and i know its difficult to say definitively ‘this is your issue,….’ when looking at abbreviated and scrubbed code. In lieu of a definite answer i’ll take suggestions as to how to debug this issue. I’ve been playing aorund in the browser console and i’ve found that the ‘player’ attribute of my VideoPlayer object is null. When i ran the same console query against the working version of this project it spits back the object tag. I can’t directly set the object tag, because it will break with the conventions used in the previous version which i need to maintain.

HELP!!!!!!!!!!!!!!!

  • 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-27T18:22:40+00:00Added an answer on May 27, 2026 at 6:22 pm

    So i figured out what my problem was. Despite my best efforts to be robust in description of the problem, i left out one key fact that would probably have helped to solve my issue. I was developing my application locally before moving to an actual development server. When using a flash application in a local context, communications from the internet are disabled by default. If you google ‘adobe security settings’, one of the top links will take you to an adobe security settings page where you can cchose folders on your local machine that you want to allow this external communication. My swf file would tries early on to make a connection to our servers befor initializing the external call backs, if it can’t do that it just waits, and thus none of my functions were becoming declared functions. I actually had this problem when working through my initial iteration of this project, but didn’t think of it until yesterday.

    Thank you for everyone who supplied solutions. Having done this twice i can vouch for the fact that everything that has been suggested here is something that might hold a person up while trying to program and external interface flash application.

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

Sidebar

Related Questions

I took over a project several months ago that involved polymorphic associations that were
I've started to use XCode several months ago, after using IntelliJ for several years,
I downloaded and installed Eclipse using Yoxos a few months ago. Since then, several
I started using Dist::Zilla several months ago. However, at YAPC::NA someone mentioned that they
Several months ago I asked something similar , but I was using JavaScript to
Several months ago, I installed ruby 1.9.1 on Mac OSX 10.6 using the instructions
Several months ago I learned from an answer on Stack Overflow how to perform
I wrote a small PHP application several months ago that uses the WordPress XMLRPC
I built a Winform app several months ago that schedules appointments for repair techs.
I've switch from VB.NET to C# several months ago, while there are a lot

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.