Video Actor

bernard

  • Posts: 120
Looking at the log file it shows that the download worked fine. It is only when Stencyl tries to open it after download, that the problem occurs.

After further trials I found that this happens if only I select a WEB/Mobile game.

It opens correctly when I create a normal Game. So it is something to do with the Mobile game and your behaviour.

Also now looking at the code in the normal WEB game, it is all action script. I think you should mention this on the forge in the description as it is not obvious.

niccosw

  • Posts: 91
Yes, this behavior is Flash only. It was created months before iStencyl was even availible.

I'll put a warning in the Forge.

psypol

  • Posts: 61
hello

i managed to display a video from an url online with this behavior

BUT now i want to copy the video locally so i follow this explanation but i can't manage to make it work. i don't see the video displayed

Quote
How do I test video locally?
If you want to test using a relative path, you should place the video files in "StencylWorks\plaf\flash". Then you would call them by name like "myVideo.flv". I often create a separate folder called "assets" in the "flash" folder. Then I call: "assets/myVideo.flv". If I placed the folder higher in the hierarchy, such as "StencylWorks\assets" then I would use "../../assets/myVideo.flv".

what is this folder anyway ? StencylWorks\plaf\flash (what do 'plaf' stands for ? i tried to create it by myself ..)

I also tried to put the video in :
stencylworks\preview\game\resources
stencylworks\games\video_test\resources
stencylworks\games\video_test\libraries\flash

none of this location works.

thanks for your help
thanks for your help

« Last Edit: February 10, 2012, 09:25:34 am by psypol »

coleislazy

  • *
  • Posts: 2607
I'm not sure where you would have to put it, but be aware that this won't bundle it into your SWF. When you host the game online, you'd have to host the video online anyway.

psypol

  • Posts: 61
thanks. anyway its not intended for sharing in my case. any toughts ?
the worst thing is that when trying to reach an online video the debug view is verbose but
not when you put a local path

captaincomic

  • *
  • Posts: 6108
You can try it with an absolute path, should be easier to get right than with a relative path.

Although I guess it's a security sandbox problem. If it worked with a remote video, you're probably in a remote sandbox and local files will not be accessible.

You can check the type of the security sandbox by putting this in a code block in "when created" in one of your behaviors:
Code: [Select]
import flash.system.Security;
print(Security.sandboxType);
and then check the console.

Edit: you should see "localWithFile", "localWithNetwork" or "remote".

« Last Edit: February 10, 2012, 01:50:31 pm by captaincomic »

psypol

  • Posts: 61
Quote
You can try it with an absolute path, should be easier to get right than with a relative path.
This doesn't worked neither :-(

Quote
You can check the type of the security sandbox by putting this in a code block in "when created" in one of your behaviors:
Code: import flash.system.Security;
print(Security.sandboxType);
 and then check the console.
Edit: you should see "localWithFile", "localWithNetwork" or "remote".
So the console displays : localWithFile

Help :-)

coleislazy

  • *
  • Posts: 2607
In your path, make sure you are using forward slashes ( / ) not backslashes ( \ ).

psypol

  • Posts: 61
it works ! thanks a LOT !

OMNILABS

  • Posts: 28
Thought it might be handy to have this here... To get this working in Stencyl  2.2.0, add the following lines in the init():void function before loadStream();
Code: [Select]
addWhenUpdatedListener(null, update);
addWhenDrawingListener(null, draw);
addCollisionListener(actor, handleCollision);

And change #1
Code: [Select]
override public function update():voidto
Code: [Select]
public function update(list:Array):void
#2
Code: [Select]
override public function draw(g:Graphics, x:Number, y:Number):voidto
Code: [Select]
public function draw(list:Array, g:Graphics, x:Number, y:Number):void
#3
Code: [Select]
override public function handleCollision(event:Collision):voidto
Code: [Select]
public function handleCollision(list:Array, event:Collision):void