The Staff will always try their best to answer questions in this Forum, but we are human, and do need to rest sometimes, so we also rely on the helpful Community (you!) to help answer each other's questions as well.
Note: Our
business hours are Monday through Friday, 9AM – 6PM EST.

I have a website made in flash.
I want to embed the vimeo´s videos to my swf.
I did it before with videos from Utube, but i´ve tried with vimeo´s and it didn´t work! :(
Any know the Action Script to do it, o some could give me some help?
Thankx!
if you have a direct link to the swf, maybe there is a way to call it as an external layer, but that might be complicated and not sure if it would work.
i just don't know how. :(
Casey Pugh staff 6 months ago
We currently don't support this in our current player. We are launching a new player soon that will hopefully help you guys out when trying to embed in Flash.
[/quote]
Still no way to embed Vimeo on flash? Unbelievable!!!
What a shame :(
Sorry for the delay, but I have some good news. You can embed the Vimeo Flash player in Flash, but there are some limitations/obstacles:
- You have to use AS3
- You can only embed one Vimeo player at a time
- A mask is needed to put over the video player so the popup menu screens don't appear outside the bounds of the video player
I'll be posting a code sample in a moment.
vimeo.com/api/docs/moogaloop
we will check it out tonight! If that realy works then you are "again" a step ahead of Youtube and their rather terrible solution. Give us a night to examine it.
Greetings from Berlin.
can't manage to get the sample code working. Tried it in Flash CS3, Flex Builder 3 and pure Actionscript Project. moogaloop.swf loads, but no video is displayed.
thanks for any input,
manfred
cypres.dk/files/vimeo/test.html
cypres.dk/files/vimeo/test.fla
thanks
cypres.dk/files/vimeo/test.as
Just a few minor tweaks to the Moogaloop API from Vimeo.
Some of the stuff i changed or pondered:
- I have to export for Flash Player 9, Flash 10 gives a error about mixing AS2 with AS3
- I have to download the hubnut.swf file and store it on the same domain, as I could not get past the security checks otherwise
- I still use Security.allowInsecureDomain to allow access to vimeo.com
Since I was asked a question I will repost this, just in case I'm not the only one for which comments disappears.
I was able to embed the hubnut widget,
Example: cypres.dk/files/vimeo/test.html
Script: cypres.dk/files/vimeo/test.as
Flash CS4 .fla: cypres.dk/files/vimeo/test.fla
Just a few minor tweaks to the Moogaloop API from Vimeo. Some of the stuff i changed or pondered:
- I have to export for Flash Player 9, Flash 10 gives a error about mixing AS2 with AS3
- I have to download the hubnut.swf file and store it on the same domain, as I could not get past the security checks otherwise
- I still use Security.allowInsecureDomain to allow access to vimeo.com
I hope they fix it with Moogaloop
when loading test.fla into CS3, "Unexpected file format" error appears. What I'm doing wrong?
thanks
thanks all
I am very new to all this. So my question may appear a little stupid.
How do you download the hubnut.swf?
I would like to try what you have done for myself.
Would this work the same with badge?
cheers,
anthony...
I have downloaded the hubnut.swf and got that to work. and now would love to try and do the same thing with hans coding except using badge instead of hubnut.
Is badge a .swf file?
any ideas of how to get this happening.
any help would be appreciated.
regards,
anthony...
im just trying to figure the current state of this idea, since id like to do such a thing; put a vimeo video into a as3 swf file im creating....thanks
Yeah thats pretty much the case. I am pretty new to all of this. I used Hans script to load the hubnut widget and load that into my flash movie. I am still experimenting at the moment. But you can see how it works via the following URL. realworldmediagroup.com.au/index3.html
The Swf file runs right across the width of the page and I have positioned the player so that it fits in with the border that I created in my flash file.
I dont really like the way the hubnut looks with my set up and would much prefer to just load the single video and have that play straight away. But it doesnt seem like this can be done.... as yet...
(I have loaded some example videos into a my channel through vimeo, they arent all mine)
My knowledge of actionscripting is pretty limited, but if there is any way I can help please let me know
Hope this helps...
I did everything as explained here but I can't find were to download hubnut.swf , so I get a permission error.
Can someone tell me?
Thank's
Security.allowDomain("bitcast.vimeo.com");
var req:URLRequest = new URLRequest("bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip_id=198785&width=400&height=300&server=vimeo.com");
For the rest it is the same as the example posted on vimeo.com/api/docs/moogaloop
import flash.display.*;
import flash.net.URLRequest;
var rect:Shape = new Shape();
rect.graphics.beginFill(0xFFFFFF);
rect.graphics.drawRect(0, 0, 400, 300);
rect.graphics.endFill();
addChild(rect);
var ldr:Loader = new Loader();
ldr.mask = rect;
var url:String = "...hubnut.swf adress...";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
ldr.contentLoaderInfo.addEventListener(Event.COMPL ETE, resizeLoader);
function resizeLoader(evtObj:Event):void {
ldr.width = 400;
ldr.height = 300;
}
addChildAt(ldr,1);
Please refrain from posting the same comment multiple times.
I'm surprised the API example has been up for so long considering that it doesn't work.
*** Security Sandbox Violation ***
SecurityDomain 'http://bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip_id=2908986&width=580&height=319&server=vimeo.com' tried to access incompatible context
Is there any way to load and unload it? I also got some problems when tryinkg to include the embedding in a document with a lot of layers.
Thank's in advance
(not hubnut)
the moogaloop AS3 code not working.
im just paste that in the first frame, changed the movie id, but appears the error:
Error #2180: Its ilegal to move AVM1 content (AS1 or AS2) to another part in displayList, when he loaded to the AMV2 content (AS3).
Note: im using AS3.
im really need this.
i was really struggling to get this working - and by chance I found something.
The moogaloop was working offline, but just would load in vimeo vids online.
Turns out it was because my site loads from a seperate preloader swf file.
Must be screwing permissions somewhere as moogaloop wouldn't load from this - but if i bypassed preloader and loaded actual site file then moogaloop would play
so now off to work out how to preload from same file - but hope this might help anyone similarly stuck
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, SecurityDomain.currentDomain);
loader.load(vimeo_request, loaderContext);
and it will work fine. :)
So, it's better with :
var loaderContext:LoaderContext = new LoaderContext(false, null, SecurityDomain.currentDomain);
We've been working on this as well, and seem to have had some luck.
Example:
thecollectiv.com/dev_share/test.html
We wanted to get a single video to play inside flash, without using hubnut. Starting with Hans Duedal script (above) we reverted back to the hosted moogaloop.swf at this location:
bitcast.vimeo.com/vimeo/swf/moogaloop.swf
Since we were accessing "bitcast.vimeo.com" instead of "www.vimeo.com" we changed the Security.allowDomain:
Security.allowDomain("bitcast.vimeo.com");
Then we noticed that "&server=vimeo.com" was missing after the clip ID in the URL string, so we inserted that... and and it worked.
Notes: AS3, Flash 9
AS file:
thecollectiv.com/dev_share/moogaloop_success.as
Archive of test files:
thecollectiv.com/dev_share/moogaloop_success.zip
Also:
We tried to control variables such as color, but had no luck. If anyone has success please let me know.
@dwferrell
you are a legend...
Thankyou SOOOOO MUCH!!!
You know what I love the most. I just opened up flash, cut and pasted the script in, hit preview and walah!!! its there... AND IT WORKED!!!!!!
Sorry I may seem a little over excited by all this, but I cant tell you how bloody exciting it really is and how much this is going to improve my site.
Thanks so much to you and to everyone along the way who has added a bit towards the embedded flash player. (and to all those future better-ments too...).
Cheers guys and cheers vimeo!
anthony...
Works perfect !!!
Im having a little problem with the control bar (its not your code, probably).
see in andrebenigno.com/site_andre_flash/test4.html
When the video is running, i can't access the control bar in the normal position. The mouse pointer need to go in the top of page to show the bar.
Anyone have ideia what is this? Maybe the mask?
Anyway, 99,99% of the problem is solved for me (us).
thanks a looooooot!
(sorry about bad brazilian english)
André,
I compared our test link to your test link, and it seems that the problem you're experiencing is due to some other aspect of your code. I'll email you privately with suggestions.
unfortunately I'm not able to check that at the moment for I`m travelling through South-East-Asia.
But I`ll let you know as soon as I get back to my Laptop.
Anyway - you`re the man!
&show_title=1&show_byline=1&show_portrait=0&
color=B11F24&fullscreen=0
to the end of the URLRequest (after ...&server=vimeo.com)
This particular code also turns off the fullscreen button as its redundant on the embedded flash player. As you can see you can also control if the title and byline text are visible.
Thanks to all previous posts, without you I wouldnt of got this far.
Take a look at another example:
flowersthemovie.com/Home.html
Thank you Thank you Thank you!!!
The mouse coordinates are looking at the stage.mouseX and stage.mouseY. It will always track your mouse movement to the top left part of your stage! This means the control will get jacked up if you try to move the player around in your flash. Hopefully they fix it soon!
first of : Thanks to everyone for their input on this subject, you all helped me a great deal. special thanks to DW Ferrell !!!
I was wondering if the mouseX and Y coordinates issues might be resolved in the near future. I've done some work implementing moogaloop in a project that will go online soon and this really needs to be fixed....
Also could the mouse coordinates be 'masked' ??
I was thinking of an EventListener that detects when the mouse is over the moogaplayer and then 'resets' the coordinates... It just an idea, I suspect it might not work because the MouseX is read-only, am I right?
regards,
D
artperezjr have the same problem on his page.
Does anyone know how to fix this?
Got a question for someone more Flash/AS3 saavy then I. I've successfully implemented one of my vimeo videos into flash based on the information I've come across here. However my goal is to be able to have buttons that will switch the clip_id variable of the player, allowing me to set it up to play different vimeo clips based on the user's button selection. clip 1, clip 2, clip 3, etc,. Anyone have any ideas I could set that up based on the solution that has been worked out in this thread? A thousand thank yous in advance for any help on this matter!
Based on DW Ferrell's solution:
You can have every button call the 'startLoad()' function.
Only change the call into
'startLoad("123456");'
With a different number for every different button.
And change the function header into
'function startLoad(clip_id:String){...'
So the function picks up the different clip_ids being passed on.
You can than also safely remove the line 'var clip_id:int = ...'. It won't be of any use anymore.
every button needs an eventlistener added to it.
It means that you connect an event (click) occurring on the button, to a function. Assuming 'button01' exists, code would look like:
"button01.addEventListener(MouseEvent.CLICK, onBtn01Clicked);"
When btn01 is clicked, this calls the function "onBtn01Clicked()". So make sure that function exists:
"function onBtn01Clicked(event:MouseEvent):void { ... }"
At the dots you need to call the "startLoad()" function with the proper clip_id, making the whole function look like:
"function onBtn01Clicked(event:MouseEvent):void {
startLoad('456');
}"
This is not the most elegant/efficient way, but it explains the basics and it will do the job.
Make sure you've imported the MouseEvent library by stating at the top with all the other 'import' statements:
"import flash.events.MouseEvent;"
import flash.system.Security;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.MouseEvent;
var moogaloop:Sprite = new Sprite(); // the video player
var player_width:int=500;
var player_height:int=375;
button01.addEventListener(MouseEvent.CLICK, onBtn01Clicked);
button02.addEventListener(MouseEvent.CLICK, onBtn02Clicked);
function onBtn01Clicked(event:MouseEvent):void {
startLoad('4157301');
}
function onBtn02Clicked(event:MouseEvent):void {
startLoad('4153171');
}
function startLoad():void
{
Security.allowDomain("bitcast.vimeo.com");
var v_loader:Loader = new Loader();
var v_request = new URLRequest("bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip_id=" + clip_id + "&server=vimeo.com" + "&width=" + player_width + "&height=" + player_height + "&show_title=0&show_byline=0&show_portrait=0&color=ffffff&fullscreen=1");
v_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
v_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
v_loader.load(v_request);
}
function onCompleteHandler(e:Event):void
{
// Position the player where you want it
moogaloop.x = 13;
moogaloop.y = 15;
moogaloop.addChild(e.currentTarget.content);
// Create the mask for moogaloop
var v_mask:Sprite = new Sprite();
with( v_mask.graphics ) {
beginFill(0x000000, 1);
drawRect(moogaloop.x, moogaloop.y, player_width, player_height);
endFill();
}
addChild(v_mask);
moogaloop.mask = v_mask;
addChild(moogaloop);
}
I do believe I have made all of the changes you advised, yet for some reason it is still not working. I'm sure it's something little that I'm missing. I get the following errors when I test it:
Scene 1, Layer 'original as3', Frame 1, Line 16 1137: Incorrect number of arguments. Expected no more than 0.
Scene 1, Layer 'original as3', Frame 1, Line 20 1137: Incorrect number of arguments. Expected no more than 0.
Scene 1, Layer 'original as3', Frame 1, Line 27 1120: Access of undefined property clip_id.
"original as3" is the layer I have all the actionscript on. Any idea what I'm overlooking?
the problem is that you are using this method : startLoad('4153171');
and in your function you forget to specify the parameter !
use this function instead :
function startLoad(clip_id:String):void
{
Security.allowDomain("bitcast.vimeo.com");
var v_loader:Loader = new Loader();
var v_request = new URLRequest("bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip_id=" + clip_id + "&server=vimeo.com" + "&width=" + player_width + "&height=" + player_height + "&show_title=0&show_byline=0&show_portrait=0&color=ffffff&fullscreen=1");
v_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
v_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
v_loader.load(v_request);
}
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
So it is having a tough time putting the URL together I am assuming. I'm not sure why though. Here is my updated actionscript:
import flash.system.Security;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.MouseEvent;
var moogaloop:Sprite = new Sprite(); // the video player
var player_width:int=500;
var player_height:int=375;
button01.addEventListener(MouseEvent.CLICK, onBtn01Clicked);
button02.addEventListener(MouseEvent.CLICK, onBtn02Clicked);
function onBtn01Clicked(event:MouseEvent):void {
startLoad('4157301');
}
function onBtn02Clicked(event:MouseEvent):void {
startLoad('4153171');
}
function startLoad(clip_id:String):void
{
Security.allowDomain("bitcast.vimeo.com");
var v_loader:Loader = new Loader();
var v_request = new URLRequest("bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip_id=" + clip_id + "&server=vimeo.com" + "&width=" + player_width + "&height=" + player_height + "&show_title=0&show_byline=0&show_portrait=0&color=ffffff&fullscreen=1");
v_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
v_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
v_loader.load(v_request);
}
function onCompleteHandler(e:Event):void
{
// Position the player where you want it
moogaloop.x = 13;
moogaloop.y = 15;
moogaloop.addChild(e.currentTarget.content);
// Create the mask for moogaloop
var v_mask:Sprite = new Sprite();
with( v_mask.graphics ) {
beginFill(0x000000, 1);
drawRect(moogaloop.x, moogaloop.y, player_width, player_height);
endFill();
}
addChild(v_mask);
moogaloop.mask = v_mask;
addChild(moogaloop);
}
function onProgressHandler(e:ProgressEvent):void
{
var percent:Number = e.bytesLoaded / e.bytesTotal;
trace(percent);
}
startLoad('4157301');
Ideas?? Thanks in advance for any assistance!
boy oh boy
Got a Flash template from internet and I know very little about programming so I'll post my fla. and xml file here to see if any of you could do something for me...
media gallery fla
4shared.com/file/105121096/a0276228/media_gallery.html
media gallery swf
4shared.com/file/105121072/39c98bbf/media_gallery.html
video player fla
4shared.com/file/105121114/8732e33b/video_player.html
video player swf
4shared.com/file/105121165/bf74456a/video_player.html
and this is the xml feed for the videos...
4shared.com/file/105121139/cbb5fd04/content_video.html
As I'm very confused with all that I don't know where to place the code given by DW Ferrell
Please someone help me to make it work...
My idea is to play vimeo and feed the playlist with this xml.
Any help at all is welcome!!!
thanks
Eli
Thank you very much, and sorry about my error in english, but I use to speak spanish, because I´m from Uruguay.
Really appreciate any help - simply trying another video works for some and not others??
DOesn't anybody has the problem, that you cannot remove the clip once it startet? i mean i can remove it but the sounds stills keeps playing in the background...
anyone knows how to kick the whole player when hitting a closeBtn?
thx!!
I have had success in using the code my problem is when i try loading my main.swf into a preloader.swf i get a security sandBox Violation error any clues as to why and how to solve
cheers
Luke
Security.allowDomain("bitcast.vimeo.com");
for me it worked!I want to know if somebody knows how to activate fullscreen???
Another problem though: on hover over the video the play/pause buttons do not show. I am positioning my vimeo in the middle of the screen, weirdly enough the hover starts when the mouse is over the top left region of the screen, as if the vimeo was positioned there... but it's not...
I use Download helper for Firefox and I noticed that new videos can't be downloaded. Perhaps it's linked to our problem and/or the changes Vimeo made (like the impossibility to download source video).
Is there a Vimeo Plus user that can say if it works or not with him?
What will happen on august 1st?
Damn...
topographicmind.com:8080/web/guest/map
I got the code but i dont know how place it where i want.