Having trouble making my own plugin XD

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Having trouble making my own plugin XD

Postby time-killer-games » Wed Feb 09, 2011 4:01 am

Well, this was gonna be a plugin I was gonna make all by myself, but the stupid thing is now I need some help.

"Embed Windows Media Player Plugin"

For anyone who would like to make some presentations similar to a ms powerpoint only made with adventure maker, they might want to embed a video or two. Thus my brain gave birth to an idea.

Code: Select all
Action.ChangeDisplayResolution "1"
Action.AddComponent "MediaPlayer.MediaPlayer.1", "Wmp1"
Component("Wmp1").Visible = True
Component("Wmp1").Width = 9600
Component("Wmp1").Height = 7200
Component("Wmp1").FileName = "External\Movie.wmv"


It all works execpt for the *.FileName section, wich is the part that actually loads the media.

As far as HTML code, here's what it would look like embeded in a webpage:

Code: Select all
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="videofilename.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="videofilename.wmv" NAME="MediaPlayer"
WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>


code refference:
http://www.mediacollege.com/video/forma ... embed.html

Could anyone tell me what I'm doing wrong?

Thanks once again for all the help and support on this awsome website!
TKG
User avatar
time-killer-games
Expert Member
 
Posts: 400
Joined: Fri Dec 24, 2010 6:10 pm
Location: Virginia Beach, VA

Postby ShadowHunter » Wed Feb 09, 2011 9:50 am

Hi,

You are not describing what error message you receive, however:

First of all you might want to use the full file path to your movie during your first tests instead of "External\Movie.wmv" which makes not much sense (it does in HTML however) use: "c:\myProject\WhatEver\movie.wmv"

Understand that the "External" folder can be anywhere on a PC depedning on where the user installs the compiled project.

Use the AM "GetPath" methode to resolve the file path from the destination PC:

0 : location of the project folder
1: location of the "Root" sub-folder (in the compiled version of the project, it corresponds to the project folder)
2: location of the "External" sub-folder (default)
3: location of the "Config" sub-folder
4: location of the "Areas" sub-folder
5: location of the "Frames" sub-folder
6: location of the "FramesData" sub-folder
7: location of the "Icons" sub-folder

For example, GetPath(2) will return the path of the "External" AM-folder.

Let me know how far you got with this information.

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Lyberodoggy » Wed Feb 09, 2011 2:22 pm

What is really bugging me is that progID you use.
MediaPlayer.MediaPlayer.1 doesn't at all comply to the conventional naming rules (Componentname.classname)
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby time-killer-games » Thu Feb 10, 2011 4:57 pm

Thanks for the help guys, I've tried your method shadowhunter, but strangely it didn't work, perhaps I'm still doing this in the wrong way?

Code: Select all
Action.ChangeDisplayResolution "1"
Action.GetPath "2"
Action.AddComponent "MediaPlayer.MediaPlayer.1", "Wmp1"
Component("Wmp1").Visible = True
Component("Wmp1").Width = 9600
Component("Wmp1").Height = 7200
Component("Wmp1").FileName = "Movie.wmv"


Edit:
Never mind, when I added the full path it worked, thanks shadowhunter!
User avatar
time-killer-games
Expert Member
 
Posts: 400
Joined: Fri Dec 24, 2010 6:10 pm
Location: Virginia Beach, VA

Postby ShadowHunter » Thu Feb 10, 2011 11:18 pm

Most welcome :wink:
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron