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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:48:59+00:00 2026-06-09T16:48:59+00:00

I am trying to read the src attribute of the flash file which i

  • 0

I am trying to read the src attribute of the flash file which i get in the response of a url and create a new file through swfobject. But it returns me “undefined” when i read the src of the embed tag. My code below.

The page i am doing a post on, only has the flash file in it.

The reponse is as below:

AJAX REsponse

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="930" height="630" title="Campaign">
  <param name="movie" value="final5.swf" />
  <param name="quality" value="high" />
  <embed src="final5.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="930" height="630"></embed>
</object>

Script

$.ajax({
 url: flashUrl,
 type: "POST",
 dataType:"html",
 success: function(data, status, xhr) {
   var swfUrl = flashUrl.substr(0, flashUrl.lastIndexOf('/')) + "/" + $(data).find('embed').attr('src'); 
   $('.content').html('<div id="mySwf"></div>');
   swfobject.embedSWF(swfUrl, "mySwf", "200", "200", '9.0.0', "/resources/expressInstall.swf", flashvars, attributes, params);

  }
});

***Update (found the issue area but not the solution)

I kinda got to know what the issue is, but i don’t know y its occurring.
when i run the page with the flash file in IE. it renderes it in a wierd way

<object width="930" height="630" title="Campaign" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" altHtml="     

 <embed src="skf-final5.swf" type="application/x-shockwave-flash" width="930" height="630" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" >    </embed>
     ">

it add some altHTML attribute to the Object and the entire embed tag goes into it which screws up the entire stuff. 🙁

  • 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-09T16:49:01+00:00Added an answer on June 9, 2026 at 4:49 pm

    Well dint find the reason y we get a “altHTML” in the tag.
    but found a work around for this problem.


    Heres my solution. (please suggest if there can be any improvements)

    $.ajax({
    url: flashUrl,
    type: "POST",
    dataType:"html",
    success: function(data, status, xhr) {
        $('.layer-view .content').html('<div id="kcSwf"></div>');
                            // Building path for flash url
        var swfUrl = flashUrl.substr(0, flashUrl.lastIndexOf('/')) + "/" + $(data).findAndSelf('param[name="movie"]').attr('value'); 
        var swfWidth = $(data).findAndSelf('object').attr('width'); 
        var swfHeight = $(data).findAndSelf('object').attr('height'); 
        var swfBgColor = $(data).findAndSelf('param[name="bgcolor"]').attr('value');
    
        if(swfBgColor=="undefined") swfBgColor="#ffffff";
    
            var layerviewWidth = parseInt(swfWidth) + 20; 
            $('.layer-view .view').css('width', layerviewWidth);
    
            var flashvars = false;
            var params = {salign:'t', bgcolor:swfBgColor};
            var attributes = {};
            swfobject.embedSWF(swfUrl, "kcSwf", swfWidth, swfHeight, flashVersion, "/resources/expressInstall.swf", flashvars, params, attributes);
        }
    });
    

    Note: FYI….The sequence of the properties in swfobject is also important. The Param has to come before the attribute or else it screws up some stuff in IE. 🙂

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

Sidebar

Related Questions

I'm trying to read a file in my maven project at /src/main/resources/file.txt. I'm using
I am trying to capture read/write operations on any IMG tag's src attribute. For
I am trying to read a file using File Reader but I continue to
In the below code statement: SmbFileInputStream din==new SmbFileInputStream(src); I am trying to create a
Trying to read an RSS and select information using Linq but can't seem to
Trying to read headers for a csv file with: reader = csv.DictReader(open(PATH_FILE),skipinitialspace=True) headers =
Iam trying to read a binary file to memory and pass the starting address
I am trying to read in an XML file that I have saved to
I am trying to read some objects from a file. The code works fine
//This source is a line read from a file String src = 23570006,music,**,wu(),1,exam,\Monday9,10(H2-301)\,1-10,score,; //This

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.