How do Change swf file dimension in html....? - apache-flex

I just built a flex applcation with AS3 only.. the generated swf will expand as much as browser's window..I wish to reduce the dimension of swf file...any ideas?? Thanks..

You may need to specify your swf dimensions eg:
[SWF(width="640", height="480")]
If you're viewing it directly in your browser, you should embed your swf inside an html document and specify the dimensions of your swf.
If this is for a public facing website, I'd recommend using SwfObject.js. Or if you aren't comfortable with Javascript you can use the object tag:
<object width="640" height="480">
<param name="movie" value="your_file.swf">
<embed id="embed" src="your_file.swf" width="640" height="480"></embed>
</object>

Related

.swf will play in IE but not Chrome

I have a asp.net 3.5 page that shows a file with a .swf extension. In IE when the page is pulled up the flash file is played and all looks normal. When I look at it in Google Chrome their is just a white space where the file should be playing. Is their a way to make the file play when viewing in chrome?
Here is the code:
<object width="400" height="250">
<param name="movie" value="abc.swf">
<embed src="../StaticPages/abc.swf" width="400" height="250" />
</object>
IE 7-9 will play as long as the param value is a valid path; but Chrome and other compliant browsers require both param and embed paths to be correct.
The page that is showing the flash file is being loaded by a text file that has the text for the page and the tags in it to run the flash file.
Once I looked at the tags more I see where the issue was. the src and value path were not the same so chrome could not locate the file. When I updated the file locations to match it worked.
Thanks
Original Code
<object width="400" height="250">
<param name="movie" value="abc.swf">
<embed src="../StaticPages/abc.swf" width="400" height="250" />
Fixed/correct Code:
<object width="400" height="250">
<param name="movie" value="/StaticPages/abc.swf">
<embed src="/StaticPages/abc.swf" width="400" height="250" />
This is most likely to be related to way you embed your swf into your page.
Especially if it also occurs in other browsers like firefox.
You can use SWFObject for this. It is an open source javascript library that handles embedding swfs in all different browsers.
More information on why this occurs: http://livedocs.adobe.com/flex/3/html/help.html?content=wrapper_13.html
Or if you want a more fancy way to display video content on a browser, try
http://flowplayer.org/demos/installation/index.html
and
http://www.longtailvideo.com/players/jw-flv-player/
Could you provide the actual tags / javascript you are using to place the flash file in the page?
Have you tried opening the swf file by itself in chrome to make sure it is not just a tag issue?
As DennisJaamann points out, at least as far as firefox, there are issues with tags. Firefox won't play swfs using just the object tag without specifying the proper type.
The problem of the difference in browsers is such that if you poke at the Adobe site itself, you'll see they use a public library for embedding swfs on their own site.

ASP.NET Menu Problem With .swf file

I have a drop down menu and a swf file on an asp.net page. When the menu drops down it is behind the swf file when it should appear in front.
Add the following parameter to the OBJECT tag:
<param name="wmode" value="transparent">
Add the following parameter to the EMBED tag:
wmode="transparent"
(Taken from the Adobe site)

You tube video integration

for you tube video integration youtube provides an embed for all the you tube videos what i want is i just provide a link to the user on clicking of which it fetches the embed of that particular video and play that one in my asp.net page how to achieve this can any one help me out it ill be better if you can give some examples along with
If you look at the embed code for a few different YouTube videos, you will see that the only difference is a video ID (the "fYzblEeAt2U" part of a URL like "http://www.youtube.com/watch?v=fYzblEeAt2U")
Note that this appears twice in the embed code - first in the first param tag, and secondly in the embed tag.
So you just need to serve up the standard embedding code, with that ID being replaced by your back-end code, maybe something like this:
<object width="640" height="385">
<param name="movie" value="http://www.youtube.com/v/<% =MyVideoID %>&hl=en_GB&fs=1&rel=0"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/<% =MyVideoID %>&hl=en_GB&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed>
</object>
there is a better solution, try “Url 2 Embed library” its free http://url2embed.codeplex.com/

Multiple JWPlayers on Wordpress page

I have a Wordpress site that has a large photo slider for the header. Within that slider, I have buttons to launch videos corresponding to the current image. These are being set by custom tags within multiple posts. All the data is being passed correctly (based off of looking at the source code), however, I can only get 1 video to play while the other 2 (3 total) just appear black and won't play anything at all.
Here is my embed code:
<div id="video-block'.$videoID.'" class="video-block-player hide">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$video_width[0].'" height="'.$video_height[0].'" id="video'.$videoID.'" name="video'.$videoID.'">
<param name="movie'.$videoID.'" value="player.swf">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="wmode" value="transparent">
<param name="flashvars" value="'.$video_link[0].'&autostart=true&icons=false&mute=true">
<embed
type="application/x-shockwave-flash"
id="video'.$videoID.'"
name="video'.$videoID.'"
src="player.swf"
width="'.$video_width[0].'"
height="'.$video_height[0].'"
bgcolor="undefined"
allowscriptaccess="always"
allowfullscreen="true"
wmode="transparent"
flashvars="file='.$video_link[0].'&autostart=true&icons=false&mute=true"
/>
</object>
</div>
The $videoID is being set dynamically to ensure that elements like the div id's are unique, all other variables are being set and pulled from custom tags (and again, appear correct when I view source).
Does anyone have any suggestions as to what I might do to get multiple video players working on a single page? (Please note that I am using JWPlayer, but am not forced to use it if someone has a better solution, but that this embed code is already being launched from within another Plug-In [SlidePress] so plug-in options may not be the best solution.)
Thanks in advance for any and all help!
J
Try Firebug to see what's loading and not loading and what errors you get.

How to use flashpaper in asp.net

i want to display swf document via Adobe Flash Paper software in our asp.net web page.
can any one describe how i embed flash paper API in .net?
The FlashPaper software produces an .swf file for your document. In order to embed such a document in your web page you need to embed the .swf file via FlashPlayer in your page.
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myDocument">
<PARAM NAME=movie VALUE="myFlashPaperFile.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED href="myFlashPaperFile.swf" quality=high bgcolor=#FFFFFF
WIDTH="550" HEIGHT="400" NAME="myDocument" ALIGN=""
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
Where the example says myFlashPaperFile.swf, you'll need to put the URL where the swf containing your document can be retreived by the player. You also may want to adjust the width, height and bgcolor attributes and parameters. You'll need both the object and embed tags in order to support all browsers.
A good alternative for embedding Flash in web pages is to use SWFObject rather than to create the object/embed tags manually.

Resources