0

I'm trying the code below but its not working..

<object width="425" height="344">
  <embed src="C:\Users\fortress\Desktop\AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>

Also tried this. Not working also.

<object width="425" height="344">
  <embed src="~/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>

Problem:

  1. The swf is not displaying.
  2. I saw an error when I open the designer saying that "A control type was not specified or the specified type could not be found." I already import the shockwave-player for flash but still this error appeared..
  3. I want also that the .swf will be fullscreen played in .aspx.

I'm newbie in ASP.net.. SO yeah, please explain also the code if its okay...

Here's the output in client-side:

enter image description here

Here's the whole code for my client-side:

enter image description here

Thanks!

2
  • @Dev, that's the code I'm using...The error for that is number 1 and 2 Commented Aug 8, 2014 at 12:17
  • have a look at @se_pavel answer here: stackoverflow.com/questions/668846/… Commented Aug 8, 2014 at 12:42

2 Answers 2

2

This isn't ASP.NET, this is HTML. It might be served to the client by an ASP.NET server-side application, but that makes no difference to the client.

As far as HTML goes, your paths are broken. In both cases:

  • C:\Users\fortress\Desktop\AppointmentApp.swf
  • ~/Styles/Images/AppointmentApp.swf

In the first case you're referencing a file system path. This wouldn't work on any client computer which doesn't have that file. If the file is on the web server then no client will be able to access the web server's C: drive. In the second case you're using a server-side relative path with a ~, and no client will be able to make sense of that.

When the page renders, the path needs to reference the file from the client's perspective. Something like this:

  • /Styles/Images/AppointmentApp.swf

Or perhaps:

  • ../../Styles/Images/AppointmentApp.swf

Or whatever the path is from the rendered page to the SWF file.

I'm not 100% sure if this works well for object/embed tags, but you might be able to use the ~ path reference if you make the tag a server-side control. That should just be as easy as adding runat="server" to the tag:

<embed runat="server" src="~/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>

This would indicate to the ASP.NET application that the control needs some server-side processing before it's rendered to the client, and that processing would include evaluating relative paths.

Sign up to request clarification or add additional context in comments.

14 Comments

hey thanks for the answer...but still the same.. I'm having this error "A control type was not specified or the specified type could not be found." Did you think I need something to add in the designer?
@user2826499: Where/when do you get that error? When working with things like object and embed tags the Visual Studio design view could very easily break, but the application still works just fine. (Honestly, I recommend not even using design view and just writing the HTML.)
when I switch in design mode in ASP.NET...But then I test your code and run it its display nothing..just an empty page... :( I'm having trouble with this one...
@user2826499: Did you just blindly copy and paste my code or did you actually edit the path to point to the URL of the SWF file? I don't know the URL of some file on your computer, you need to determine that.
@user2826499: The URL from your question? Which one? And did you change it as suggested by my answer? Or make the element a server-side object? Be specific, I can't see the changes you're making.
|
0

You need both <param> movie tag and <embed>. Try this:

<object type="application/x-shockwave-flash" width="425" height="344">
<param name="movie" value="/Styles/Images/AppointmentApp.swf">
  <embed src="/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>

Good luck!

3 Comments

hmm...and your AppointmentApp.swf is in the /Styles/Images? also I don't think you can use ~/ on these tags. In order to use ~, this tag needs to have runat="server", but I don't think these tags will support that.
Hello..its working now I just copied it again..Thanks for the Help...hmmm...do you know also how to call an swf with xml?
Great! Not sure what you meant by calling a SWF with XML. XML is more encapsulating data, not displaying SWF.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.