PDA

View Full Version : Load unique .FLV's into .SWF player



ericahlstrom
03-10-2009, 11:59 AM
Here is the situation.

(1) you have many .FLV's with many more to come in the future.
(2) You create an .SWF wrapper for the (Flash Object) in AMS to see.
(3) The .FLV plays in AMS great.
(4) Now it's time to load another .FLV into the same .SWF wrapper.

Question: How can I do this in AMS without having to create an unique .SWF for each and every new .FLV I create?

reteset
03-10-2009, 12:49 PM
hope this heps a bit

Flash :


_root.AMS_command = "";
_root.FLVpath = "";

this.onEnterFrame = function()
{
if ( _root.AMS_command eq "Load")
{
_root.AMS_command = ""; // clean for next time ,and block a endless loop
_root.FLVpath = "";
player_mc.Load(FLVpath); // load flv movie with path

}
}

AMS :


Flash.SetFlashVariable("Flash1", "FLVpath", "C:\\MyMovie.flv");
Flash.SetFlashVariable("Flash1", "AMS_command", "Load");

reteset
03-10-2009, 01:35 PM
sorry it is too late to edit

flash side needs a correction


_root.AMS_command = "";
_root.FLVpath = "";

this.onEnterFrame = function()
{
if ( _root.AMS_command eq "Load")
{
player_mc.Load(FLVpath); // load flv movie with path
_root.AMS_command = ""; // clean for next time ,and block a endless loop
_root.FLVpath = "";


}
}

ericahlstrom
03-10-2009, 03:16 PM
I really appreciate your help.

Should I load PHP code into frame one of my Flash Doc?

Also, is it loading the playing automatically or do I need to import a .flv into flash to create the player first as a template?

reteset
03-10-2009, 03:38 PM
i assumed you have fimiliarity with flash,

1 : create a new flash project
2: new project comes with an empty layer & frame
3: put this code to frame's action pane


_root.AMS_command = "";
_root.FLVpath = "";

this.onEnterFrame = function()
{
if ( _root.AMS_command eq "Load")
{
player_mc.Load(FLVpath); // load flv movie with path
_root.AMS_command = ""; // clean for next time ,and block a endless loop
_root.FLVpath = "";


}
}
4: create a new layer and put a player component to this layer
5: set properties of player compnent
6: set player component's instance name as player_mc
7: compile

8: put autput swf into a folder in your AMS project
9: move that swf to your AMS page
10 : put a button on page surface
11 : and put his code to button's On click Event with correct arguments


Flash.SetFlashVariable("Flash1", "FLVpath", "C:\\MyMovie.flv");
Flash.SetFlashVariable("Flash1", "AMS_command", "Load");

ericahlstrom
03-10-2009, 04:29 PM
I followed your instructions but file isn't loading. I have attached both my ams file as well as my flash doc.

If you have time and could check the files it would be most appreciated.

reteset
03-10-2009, 05:21 PM
here is a working sample

this is a Flash 8 project and Actionscript 2.0 used
fla document is in Flash folder of AMS project

you should set file path to yours (in button's on click event)

ericahlstrom
03-10-2009, 05:29 PM
Thanks again for your time. It works and has helped a lot.;)

aae991
03-12-2009, 04:29 PM
Is there a way to get the flash component to go full screen when adding the wrapper in Flash? So far I have been unable to get the flash object in AMS 7.5 to go full screen (toggle).

Thanks.

Michael
03-14-2009, 06:38 AM
Reteset,
longedge pointed me to your flv example and it works great. I now need to make a "pause" button in addition to the play button. AMS's flash commands don't work directly, so I'm thinking that the actionscript:

_root.AMS_command = "";
_root.FLVpath = "";
this.onEnterFrame = function ()
{
if (_root.AMS_command eq "Load")
{
player_mc.load(FLVpath);
player_mc.play();
_root.AMS_command = "";
_root.FLVpath = "";
}
};

needs an addition for that to work. Is it possible to add it? My knowledge of flash is limited, but would appreciate any help with this.
Thanks,
Michael :cool

reteset
03-14-2009, 07:28 AM
here is a more advanced one

FLVPlayer Example (http://www.amsplugins.com/details.asp?ID=76&CID=4)

Imagine Programming
03-14-2009, 07:44 AM
here is a more advanced one

FLVPlayer Example (http://www.amsplugins.com/details.asp?ID=76&CID=4)

Aaah Flash 8, finally a fla i can open lol :p

It's hard to find old fla's these days

reteset
03-14-2009, 07:59 AM
yes , i agree

Flash 8 is more stable , more easy , more clean and looks more professional than Adobe's **

i do not want to install an Operating system for make a flash movie

just my idea

Imagine Programming
03-14-2009, 09:08 AM
yes , i agree

Flash 8 is more stable , more easy , more clean and looks more professional than Adobe's **

i do not want to install an Operating system for make a flash movie

just my idea

hehe i totally agree, at my college we had to install flash cs4 on our college laptops. But first we had to install more ram (on top of the 1,5 gb in it) before it would do anything...

So we stuck with Macromedia flash 8

longedge
03-14-2009, 11:58 AM
Hah..... I struggle with Actionscript and have to make use of autocomplete (after you put the "." in) so I was a bit foxed as to how to get a pause. Typing "player_mc.pa" doesn't show "pause" as an option. I started thinking about getting the current position and then doing something like a gotandplay *but* player_mc.pause(); works :rolleyes I've said it before - I hate flash :lol

Thanks Reteset for the example :yes

siray
03-14-2009, 11:08 PM
Thanks, Reteset. Finally.... an flv player... ^_^

Michael
03-15-2009, 07:24 AM
ReTeset,
Thanks a million for the great example.

One final thing, is there a way for the FLV video to load AND pause at the beginning? There is a white screen where the video goes until you click "load". Actually, I've added the load command to the page onshow, but it plays immediately. Since I need the user to read text before clicking on the video, it would be necessary for it not to play, only show.

Sorry, I hope I'm not exceeding the requests limit. :o But just a little more and I can complete this project.

Again, thanks for all you've done. I know others appreciate it as well.
Michael :cool

reteset
03-15-2009, 08:53 AM
It is no probem

just remove or comment Red line out
video will no longer start


_root.AMS_command = "";
_root.FLVpath = "";
_root.FLV_Volume = 0;
this.onEnterFrame = function ()
{
if (_root.AMS_command eq "Load")
{
player_mc.load(FLVpath);
player_mc.play();
_root.AMS_command = "";
_root.FLVpath = "";
}
else if (_root.AMS_command eq "Play")
{
player_mc.play();

_root.AMS_command = "";

}
else if (_root.AMS_command eq "Pause")
{
player_mc.pause();

_root.AMS_command = "";

}
else if (_root.AMS_command eq "Stop")
{
player_mc.stop();

_root.AMS_command = "";

}
else if (_root.AMS_command eq "Volume")
{
player_mc.volume = _root.FLV_Volume;

_root.AMS_command = "";
_root.FLV_Volume = 0;
}
};

reteset
03-15-2009, 09:34 AM
Hah..... I struggle with Actionscript and have to make use of autocomplete (after you put the "." in) so I was a bit foxed as to how to get a pause. Typing "player_mc.pa" doesn't show "pause" as an option. I started thinking about getting the current position and then doing something like a gotandplay *but* player_mc.pause(); works :rolleyes I've said it before - I hate flash :lol

Thanks Reteset for the example :yes

you can see all properties , events , procedures
via clicking Plus button that is on top of script editor
that menu contains everything about a component and build-in AS.2 classes

Michael
03-15-2009, 10:49 AM
Reteset,
It works like a charm! Can't thank you enough.

The IR guys ought to make this thread a "sticky". Anyone with just a little Flash knowledge (...and the program) AND YOUR EXAMPLE, can build an FLV player for AMS.

Great work!
Michael:cool

longedge
03-16-2009, 03:49 AM
you can see all properties , events , procedures
via clicking Plus button that is on top of script editor
that menu contains everything about a component and build-in AS.2 classes

:yes Yes I see it now, I get stuck in my ways and have always relied on autocomplete. I wish I had the time to play around with flash a bit more but it's always a case of it's urgent and "Can I have it now..."

Teqskater
06-07-2009, 05:26 PM
Is there a way to "seek" with the second version of the player?

reteset
06-08-2009, 10:46 AM
Is there a way to "seek" with the second version of the player?

currently No
i am going to update it for you

Teqskater
06-09-2009, 10:35 AM
Thanks reteset.

I appreciate that. Im good with ams but i dont know about flash and his actionscript. Looks pretty easy tough.

reteset
06-09-2009, 11:29 AM
hi ,
i made some changes on it

you can download from here (http://www.amsplugins.com/details.asp?ID=76&CID=4)

Teqskater
06-10-2009, 09:48 AM
Thanks reteset :yes. THANKS!!!! :lol

I Realy appreciate that. And that was a quick fix.

so far working perfectly.

reteset
06-10-2009, 01:23 PM
hi,

there was a simple problem in sample swf
thanks to longedge for report this issue

if you are using this sample you should download a new copy
or if you can edit fla source , just apply following steps

replace red line


else if (_root.AMS_command eq "Volume")
{
player_mc.seekvolume = _root.FLV_Volume;
_root.AMS_command = "";
_root.FLV_Volume = 0;

}

with blue line , like below


else if (_root.AMS_command eq "Volume")
{
player_mc.volume = _root.FLV_Volume;
_root.AMS_command = "";
_root.FLV_Volume = 0;

}

thanks

Teqskater
06-12-2009, 01:41 PM
Got it,

Thanks again.

Erick
07-01-2009, 09:06 AM
i wanto execute a fusion chart in a flash object, but always says error loading data, how do i put the xml code and execute