mp4/m4a support for AM?

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

mp4/m4a support for AM?

Postby Sunny Day » Mon Apr 13, 2009 5:56 pm

Will AM be getting mp4/m4a? At the moment I see it can just do mp3, will AM be upghraded or are there any plug ins that make it possible to use the mp4/m4a format?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Lyberodoggy » Mon Apr 13, 2009 8:16 pm

You just need a codec pack for windows media player, or the newest player ocx...

I suggest the K-lite codec pack
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Sunny Day » Mon Apr 13, 2009 11:35 pm

I dont think its a matter of codecs, when one adds sound to ones projects, I tried with .m4a, AM will not import the sound, it says its an invalid format. So it looks like that file format is not supported by AM.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Koetsu » Tue Apr 14, 2009 5:00 am

If I recall, m4a is a protected format. AM probably can't import DRM'd files.
User avatar
Koetsu
Member
 
Posts: 19
Joined: Mon Apr 06, 2009 1:46 am

Postby Lyberodoggy » Tue Apr 14, 2009 8:03 am

You could just put it in the External folder and then use the Custom Playsound pocedure (vbs). That's what I thought you did.


Still, you can also convert your sounds to something else using SUPER (free converter)
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Sunny Day » Tue Apr 14, 2009 2:34 pm

I will be compiling the program as a html, then Ill See about editing the html code and changing it to play the other sound format, Ill see if that works.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Sunny Day » Tue Apr 14, 2009 5:15 pm

I compliled it as html, sound doesnt work. I even tried a test with a wav file

here is a test page html


Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test</title>
<meta name='viewport' id='viewport' content='width=480;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script>
var remainingElementsToLoad = 1;
function elementLoaded(){
  remainingElementsToLoad--;
  if (remainingElementsToLoad == 0){
    parent.showNextFrame();
  }
}
var hotspotsCount = 0;
var hotspot;
hotspot = new Array;
</script>
</head>
<body bgcolor='000000' onLoad='parent.initializeFrame();'>
<div id='textBackgroundPreload' style='position:absolute; left:0px; top:0px;'><img width=1 height=1 src='textbackground.png' /></div>
<div id='hourglassPreload' style='position:absolute; left:0px; top:0px;'><img width=1 height=1 src='hourglass.png' /></div>
<div id='background' style='position:absolute; left:0px; top:0px; width:480px; height:272px;'><img src='00005.a' onLoad='elementLoaded();' /></div>
<div id='textBackground' style='position:absolute; left:0px; top:245px; visibility:hidden;'><img width=480 height=27 src='textbackground.png' /></div>
<div id='message' style='position:absolute; color:#FFFFFF; text-align:center; left:0px; top:252px; width:480px; height:32px; visibility:hidden'>_</DIV>
<div id='hourglass' style='position:absolute; left:224px; top:104px; visibility:hidden;'><img width=32 height=64 src='hourglass.png' /></div>
</body>
</html>


I dont see anything about sound in that, but there again I dont know html very well at all.

Why am I outputting as html, I tried using AM to make an iphone app, turns out it dont make iphone apps, it makes web apps, or a web page if you like. You cant sell web apps in the apple store, so I had a programmer make me a wrapper for web apps.

So I thought, lets use AM to make a web page and wrap it, I design app for windows, then output as html, but no sound. No idea why, sound isnt a hard function to add to web pages, the test example above is supposed to have background sound loop, ifs it in there, can it be edited in, I have no idea, seems AM is not for web pages or iphone apps at all, seems like one would be better using a web page editor, AM seems like a good idea, but no sound, whats that about. I see nothing in that html pointing to it, do you?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby reneuend » Tue Apr 14, 2009 5:28 pm

The html feature in AM is experimental as shown on the AM menu bar. Maybe in the future, the HTML feature will be enhanced. :)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Sunny Day » Tue Apr 14, 2009 5:32 pm

Here is also the code to a test page with a hotspot to play sound

Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test</title>
<meta name='viewport' id='viewport' content='width=480;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script>
var remainingElementsToLoad = 2;
function elementLoaded(){
  remainingElementsToLoad--;
  if (remainingElementsToLoad == 0){
    parent.showNextFrame();
  }
}
var hotspotsCount = 1;
var hotspot;
hotspot = new Array;
hotspot[1] = new parent.hotspotClass('','','',null,null,null,null,null,"");
</script>
</head>
<body bgcolor='000000' onLoad='parent.initializeFrame();'>
<div id='textBackgroundPreload' style='position:absolute; left:0px; top:0px;'><img width=1 height=1 src='textbackground.png' /></div>
<div id='hourglassPreload' style='position:absolute; left:0px; top:0px;'><img width=1 height=1 src='hourglass.png' /></div>
<div id='background' style='position:absolute; left:0px; top:0px; width:480px; height:272px;'><img src='00005.a' onLoad='elementLoaded();' /></div>
<div id='hotspot1' style='position:absolute; left:8px; top:6px; width:459px; height:255px;'><img id='hotspotImg1' src='transparent.gif' width=459 height=255 onClick='parent.doHotspotClick(1);' onLoad='elementLoaded();' /></div>
<div id='textBackground' style='position:absolute; left:0px; top:245px; visibility:hidden;'><img width=480 height=27 src='textbackground.png' /></div>
<div id='message' style='position:absolute; color:#FFFFFF; text-align:center; left:0px; top:252px; width:480px; height:32px; visibility:hidden'>_</DIV>
<div id='hourglass' style='position:absolute; left:224px; top:104px; visibility:hidden;'><img width=32 height=64 src='hourglass.png' /></div>
</body>
</html>


under the hotspot it just says null, perhaps something can be pasted in here for the html
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby reneuend » Tue Apr 14, 2009 6:27 pm

Now you have my curiousity going. :)

When I get a chance, I'll see what it takes to add sound. It may be a couple days before I have an answer.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Sunny Day » Tue Apr 14, 2009 7:24 pm

What I want personally is to see.
page has background sound, looped.
hit hotspot and background sound stops.

Also being able to close the app is useful as well.
So press hotspot and it exits the web page, it closes the app down.

And if I could have all my dreams, hit hotspot opens a web page.

That would make me a very happy man indeed.

Ive just checked, also Web page fade transition does not work either, not even in IE.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Lyberodoggy » Wed Apr 15, 2009 8:59 am

<BGSOUND SRC="helloo.wav">

This is the html code for background sound. I don't know if you can stop it tho.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Sunny Day » Wed Apr 15, 2009 4:19 pm

How about to loop the sound?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Chromegloss55 » Wed Apr 15, 2009 6:10 pm

Could you just use mp3s instead of mp4 files.

I think this converter will change them for you:

http://www.maniactools.com/soft/m4a-to-mp3-converter/
Chromegloss - Vanishes and then re-appears at complete random. [Working on Advanced Section of VBScript guide]
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Sunny Day » Wed Apr 15, 2009 6:35 pm

It doesnt matter what sound, it doesnt play them, not even wavs.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 6:45 pm

You can add to the index.html in the <head> part this code, and it should work - at least for me in Firefox and Internet Exporer it does work:

<embed src="filename.wav" autostart="true" loop="true" hidden="true"><noembed>
BGSOUND src="filename.wav"</noembed>

I have the wav file in the same folder as all .html files
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Sunny Day » Wed Apr 15, 2009 7:05 pm

Wont that just stick the wav in the index page, what about the other pages I have a sound looping in each page, when I click on a button to go to a new page, the button has turn sound off. then of cource when Im on the new page, that page has its own looping sound. Every page I go to, it has its own looping sound in the background.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 7:07 pm

When you play an HTML game made with AM, it will always stay on the index.html page, and the sound will play throughout the game if you add a sound to the index.html page.
The other frames are called according to what you click and "embedded" as screen within the index page as iFrame elements.
Just look at the URL when you play an HTML game, it stays index.html.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Sunny Day » Wed Apr 15, 2009 7:43 pm

so I only edit that index page I think is what you are saying.

I did a test here.
Its 3 pages.

index page, its called home in my frames title, has a background sound, and a link to page 1,
page01 has another background sound and a link to page 2
page02 just has a background sound.

So 3 pages, 3 different backgound sounds.
When I test within AM, all backgound looping sounds play. I didnt need to add to the button links switch sound off, it did that automatic upon going to a new page.

Here is the code from the index.

Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test</title>
<meta name='viewport' id='viewport' content='width=480;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script>
var iFrm = '00009.htm';
var loadingFrameSet = true;
var currentIFrameIndex = 1;
var nextFrameLoading = false;
//var cursorW = 64;
//var cursorH = 64;
var loadingDelay = 1500;
var posX = 0;
var posY = 0;
//var currentHotspot;
//var currentHotspotIndex = 0;
var messageTimeoutID = 0;
//var showNextFrameTimeoutID = 0;
var frameTimerTimeoutID = 0;
var lastTimeoutID = setTimeout("", 50);
var firstFrameInitialized = false;
var currentWidth = 0;

function startup(){
      loadingFrameSet = false;
      //if (navigator.userAgent.indexOf('iPhone') != -1) {
      setInterval("checkForScreenSizeChange()", 400); // Should be "lastTimeoutID = " but there is the line after
      lastTimeoutID = setTimeout("hideAddressBar()", 100);
      //}
      openFrame(iFrm, 0);
}
function hideAddressBar(){
      window.scrollTo(0, 1);
}
function checkForScreenSizeChange()
{
    if (window.innerWidth != currentWidth)
    {
        currentWidth = window.innerWidth;
        lastTimeoutID = setTimeout("hideAddressBar()", 100);         
    }
}
function getCurrentIFrameRef(){
      //return document.getElementById("iFrame" + currentIFrameIndex);
      return window.frames["iFrame" + currentIFrameIndex];
}
function getVariable(variableName){
      return eval(variableName);
}
function setVariable(variableName,variableValue){
        eval(variableName + "=" + variableValue);
}
function hotspotClass(hyperlink,mousePointerSrc,restartAnimation,variablesToChangeTo0,variablesToChangeTo1,variablesToInvert,variablesMustBe0,variablesMustBe1,textToDisplay) {
        this.hyperlink = hyperlink;
        this.mousePointer = new Image();
        if (mousePointerSrc != ""){this.mousePointer.src = mousePointerSrc;};
        this.restartAnimation = restartAnimation;
        this.variablesToChangeTo0 = (variablesToChangeTo0 == null) ? new Array : variablesToChangeTo0;
        this.variablesToChangeTo1 = (variablesToChangeTo1 == null) ? new Array : variablesToChangeTo1;
        this.variablesToInvert = (variablesToInvert == null) ? new Array : variablesToInvert;
        this.variablesMustBe0 = (variablesMustBe0 == null) ? new Array : variablesMustBe0;
        this.variablesMustBe1 = (variablesMustBe1 == null) ? new Array : variablesMustBe1;
        this.textToDisplay = textToDisplay;
}
function doHotspotClick(hotspotIndex){
      hideAddressBar();
      if (nextFrameLoading == false){
         var hotspotItemRef=getCurrentIFrameRef().hotspot[hotspotIndex];
         for(var i=0;i<hotspotItemRef.variablesToChangeTo0.length;i++){
            setVariable(hotspotItemRef.variablesToChangeTo0[i],0);
         }
         for(var i=0;i<hotspotItemRef.variablesToChangeTo1.length;i++){
            setVariable(hotspotItemRef.variablesToChangeTo1[i],1);
         }
         for(var i=0;i<hotspotItemRef.variablesToInvert.length;i++){
            setVariable(hotspotItemRef.variablesToInvert[i],1-getVariable(hotspotItemRef.variablesToInvert[i]));
         }
         if (hotspotItemRef.hyperlink != ""){
            openFrame(hotspotItemRef.hyperlink, 0);
         } else {
            updateHotspotsVisibility();
         }
         if (hotspotItemRef.textToDisplay != ""){
               displayMessage(hotspotItemRef.textToDisplay);
         }
      }
}
function openFrame(sFrameName, timeoutID){
        if (nextFrameLoading == false && (timeoutID == 0 || timeoutID == frameTimerTimeoutID)){
         nextFrameLoading = true;
         if (firstFrameInitialized == true) {
            //getCurrentIFrameRef().document.getElementById("cursor").style.visibility = "hidden";
            getCurrentIFrameRef().document.getElementById("hourglass").style.visibility = "visible";
         }
         
         // RESET TIMERS:
         clearTimeout(messageTimeoutID);
         clearTimeout(frameTimerTimeoutID);
         
         currentIFrameIndex = 1 - currentIFrameIndex;
         getCurrentIFrameRef().location.replace(sFrameName);
         
         //We now wait for the frame images to load, and fire the ShowNewFrame() method when they are all loaded.
         
         //lastTimeoutID = setTimeout("showNextFrame('" + (lastTimeoutID + 1) + "');", loadingDelay);
         //showNextFrameTimeoutID = lastTimeoutID;
      }
}
//function showNextFrame(timeoutID){
function showNextFrame(){
      //if (timeoutID == 0 || timeoutID == showNextFrameTimeoutID){
         //document.getElementById("iFrame" + currentIFrameIndex).style.visibility = "visible";
         document.getElementById("iFrame" + currentIFrameIndex).style.width = 480;
         document.getElementById("iFrame" + currentIFrameIndex).style.height = 272;
         //document.getElementById("iFrame" + (1 - currentIFrameIndex)).style.visibility = "hidden";
         document.getElementById("iFrame" + (1 - currentIFrameIndex)).style.width = 0;
         document.getElementById("iFrame" + (1 - currentIFrameIndex)).style.height = 0;
         getCurrentIFrameRef().document.getElementById("hourglass").style.visibility = "hidden";
         //scroll(0,0);
         nextFrameLoading = false;
      //}
}
function addFrameTimer(sDestinationFrame, timerDuration){
      lastTimeoutID = setTimeout("openFrame('" + sDestinationFrame + "', " + (lastTimeoutID + 1) + ");", timerDuration);
      frameTimerTimeoutID = lastTimeoutID;
}
function displayMessage(messageText){
        var messageRef = getCurrentIFrameRef().document.getElementById("message");
        var textbackgroundRef = getCurrentIFrameRef().document.getElementById("textBackground");
        messageRef.style.visibility = "hidden";
        messageRef.innerHTML = unescape(messageText);
        textbackgroundRef.style.visibility = "visible";
        messageRef.style.visibility = "visible";
        lastTimeoutID = setTimeout("removeMessage(" + (lastTimeoutID + 1) + ");", 3000);
        messageTimeoutID = lastTimeoutID;       
}
function removeMessage(timeoutID){
   if (timeoutID == 0 || timeoutID == messageTimeoutID){
      var messageRef = getCurrentIFrameRef().document.getElementById("message");
      var textbackgroundRef = getCurrentIFrameRef().document.getElementById("textBackground");
      messageRef.style.visibility = "hidden";
      textbackgroundRef.style.visibility = "hidden";
   }
}
function initializeFrame(){
      if (loadingFrameSet == false) { // Prevents bugs when user clicks "Reload"
         updateHotspotsVisibility();
         if (firstFrameInitialized == true) {
               getCurrentIFrameRef().document.getElementById("message").style.visibility = "hidden";
         } else {
               firstFrameInitialized = true;
               var sStr = "%50%6F%77%65%72%65%64%20%62%79%20%41%64%76%65%6E%74%75%72%65%20%4D%61%6B%65%72%";
               sStr = sStr + "20%28%77%77%77%2E%61%64%76%65%6E%74%75%72%65%6D%61%6B%65%72%2E%63%6F%6D%29";
               displayMessage(sStr);
         }
      }
}
function shouldHotspotBeVisible(hotspotItemRef){
        for(var i=0;i<hotspotItemRef.variablesMustBe0.length;i++){
                if (getVariable(hotspotItemRef.variablesMustBe0[i]) != 0) {return false;}
        }
        for(var i=0;i<hotspotItemRef.variablesMustBe1.length;i++){
                if (getVariable(hotspotItemRef.variablesMustBe1[i]) != 1) {return false;}
        }
        return true;
}
function updateHotspotsVisibility(){
        var hotspotRef;
        var newVisibility;
        for(var i=1;i<=getCurrentIFrameRef().hotspotsCount;i++){
                hotspotRef = getCurrentIFrameRef().document.getElementById("hotspot" + i);
                newVisibility = shouldHotspotBeVisible(getCurrentIFrameRef().hotspot[i]) ? "visible" : "hidden";
                if (hotspotRef.style.visibility != newVisibility) {
               //if (getCurrentIFrameRef().hotspot[i].restartAnimation != "") {
               //   if (newVisibility == "visible") {
               //      restartHotspotAnimation(i);
               //      getCurrentIFrameRef().document.getElementById("hotspotImg" + i).src = getCurrentIFrameRef().hotspot[i].restartAnimation;
               //   }
               //}
                    hotspotRef.style.visibility = newVisibility;
                    //getCurrentIFrameRef().document.getElementById("cursor").style.visibility = "hidden";
                }
        }
}
//function restartHotspotAnimation(hotspotIndex){
//      var hotspotRef = getCurrentIFrameRef().document.getElementById("hotspot" + hotspotIndex);
//      var oldPosition = hotspotRef.style.top;
//      hotspotRef.style.top = 1000;
//      getCurrentIFrameRef().scroll(1,0);
//      getCurrentIFrameRef().scroll(0,0);
//      hotspotRef.style.top = oldPosition;
//}
//function backgroundInHandler(hotspotIndex,hotspotRef){
//        if (nextFrameLoading == false){
//         if (hotspotIndex != currentHotspotIndex){
//            getCurrentIFrameRef().document.getElementById("cursor").style.visibility = "hidden";
//         }
//         currentHotspot = hotspotRef;
//         currentHotspotIndex = hotspotIndex;
//      }
//}
//function hotspotInHandler(hotspotIndex,hotspotRef){
//        if (nextFrameLoading == false){
//         if (hotspotIndex != currentHotspotIndex){
//            if (getCurrentIFrameRef().hotspot[hotspotIndex].mousePointer.src != "") {
//                  getCurrentIFrameRef().document.getElementById("cImage").src = getCurrentIFrameRef().hotspot[hotspotIndex].mousePointer.src;
//                  tempLeft = parseInt(hotspotRef.style.left) + Math.floor(parseInt(hotspotRef.style.width) / 2) - Math.floor(cursorW / 2);
//                  tempTop = parseInt(hotspotRef.style.top) + Math.floor(parseInt(hotspotRef.style.height) / 2) - Math.floor(cursorH / 2);
//                  getCurrentIFrameRef().document.getElementById("cursor").style.left = tempLeft;
//                  getCurrentIFrameRef().document.getElementById("cursor").style.top = tempTop
//                  getCurrentIFrameRef().document.getElementById("cursor").style.visibility = "visible";
//            } else {
//                  getCurrentIFrameRef().document.getElementById("cursor").style.visibility = "hidden";
//            }
//         }
//         currentHotspot = hotspotRef;
//         currentHotspotIndex = hotspotIndex;
//      }
//}
//function cursorMoveHandler(e){
//
//      if (nextFrameLoading == false){
//         if (!((posX > parseInt(currentHotspot.style.left)) && (posX < (parseInt(currentHotspot.style.left) + parseInt(currentHotspot.style.width))) && (posY > parseInt(currentHotspot.style.top)) && (posY < (parseInt(currentHotspot.style.top) + parseInt(currentHotspot.style.height)))))
//         {
//               getCurrentIFrameRef().document.getElementById("cursor").style.visibility = "hidden";
//         }
//      }
//      
//}

</script>
</head>
<body bgcolor='rgb(0,0,0)' onload='startup();' >
<iframe id="iFrame0" name="iFrame0" src="" scrolling="no" width="480" height="272" frameborder="0" style="position: absolute; left: 0px; top: 0px; visibility: visible;"></iframe>
<iframe id="iFrame1" name="iFrame1" src="" scrolling="no" width="480" height="272" frameborder="0" style="position: absolute; left: 0px; top: 0px; visibility: visible;"></iframe>
</body>
</html>



So this is what I edit to make the backgound sounds work? Here are my sounds

index, the first page, called home in our frame title - completed.wav
page01 - compaccessed.wav
page02 - access_denied.wav

What can I do to make my sounds work?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 7:50 pm

Well, you could do it like this - checked and worked in FF and IE for me.

Add the sound files in the <head> </head> part of the frames where you wish them to play with this code:

<embed src="door_knob.wav" autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="door_knob.wav"</noembed>

(replace the name of the wav)
Make sure you have the sound files in the same folder as the other ressources for the game.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Sunny Day » Wed Apr 15, 2009 8:15 pm

So do I do this on just the index page, or on every page, for example this made

index.html
00009.htm
00010.htm
00011.htm

Do I do this in each one, or just the index, if its just in the index, how does it know which sound to play. or is it in there some place, I just need to post this below

Code: Select all
<embed src="completed.wav" autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="completed.wav"</noembed>
<embed src="compaccessed.wav" autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="compaccessed.wav"</noembed>
<embed src="access_denied.wav " autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="access_denied.wav "</noembed>


in the index html some place inside here <head> </head> some place in that in the index only, and it will work?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 8:18 pm

You put the code for the sound on each .html page where you wish to use it. You can use 1 sound per page with this method.

E.g. I had this on the index.html

Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Sample game for iPhone-iPodTouch</title>
<meta name='viewport' id='viewport' content='width=320;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<embed src="door_knob.wav" autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="door_knob.wav"</noembed>
...etc.


And this on another .html page

Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Sample game for iPhone-iPodTouch</title>
<meta name='viewport' id='viewport' content='width=320;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<embed src="doorbell.wav" autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="doorbell.wav"</noembed>
etc.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Sunny Day » Wed Apr 15, 2009 8:28 pm

Ahh, so this is fine below then? just checking as <!--[if lt IE 7.]> comes after, I posted your script in before as you have, this works fine below then?

Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test</title>
<meta name='viewport' id='viewport' content='width=480;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<embed src="door_knob.wav" autostart="true" loop="false" hidden="true"><noembed>
BGSOUND src="door_knob.wav"</noembed>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script>
var remainingElementsToLoad = 2;
function elementLoaded(){
  remainingElementsToLoad--;
  if (remainingElementsToLoad == 0){
    parent.showNextFrame();


Also, the pages are marked as
00009.htm
00010.htm
00011.htm
I didnt name the frames this, how can I tell which is which, so I can post the right sound in each htm file I have sounds on, if I open up 00009.htm, Im not sure what frame thats for, is there a way to tell what htm file is pointing to, so I tell what frame its for?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 8:34 pm

Well, just open the .html page with your browser and check which one it is :)

Then add the sounds as mentioned, and then test the game by opening the index.html with your browser.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Sunny Day » Wed Apr 15, 2009 8:54 pm

Seems your saying, all the referances for each htm page are in the index html, open up the index html and it tells you the names for every htm page, ie it will say someplace, htm page is this frame.

I think thats what you are saying, I'm going blind looking. Im searching to the name of the artwork, the name of the frame, Im looking in the index.html, I'm looking in each of the htm pages.

What are you looking under, I can run a search from my editor, I stick what in to find a referance to something, I'm searching frame name, artwork, Im searching .jpg. Anything that gives a referance to what each htm page refers to what frame in the app. What do you look under or search to find this?
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 9:04 pm

I look in the output folder that AM has created. It contains all resources of the game.

I just open each .htm page (like 00009.htm, 00010.htm, 00011.htm) with my browser to see which one it is. Then I open them with Notepad, and add the approriate code for the sound.

Oh, and the references can be found in the source code, e.g.:
src='00009.a
src='00012.a
etc.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Sunny Day » Wed Apr 15, 2009 9:14 pm

Thats what Im doing, I open up the pages, and see what page it is, but I cannot see which it is, I didnt name a frame 00009.htm, thats what AM calles it, I open it up, and I'm looking at the code, I cant find which frame its talking about, Ive got it open, I'm looking at the code, Im sticking all sorts of terms in, I cant find where it says what frame it is.


here is 00011.htm, I see nothing in that pages code below that says what frame it is inside of AM

Code: Select all
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test</title>
<meta name='viewport' id='viewport' content='width=480;initial-scale=1.0;minimum-scale=1.0;maximum-scale=1.0;user-scalable=false;'>
<meta name='GENERATOR' content='Adventure Maker version 4.5.2'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script>
var remainingElementsToLoad = 2;
function elementLoaded(){
  remainingElementsToLoad--;
  if (remainingElementsToLoad == 0){
    parent.showNextFrame();
  }
}
var hotspotsCount = 1;
var hotspot;
hotspot = new Array;
hotspot[1] = new parent.hotspotClass('','','',null,null,null,null,null,"");
</script>
</head>
<body bgcolor='000000' onLoad='parent.initializeFrame();'>
<div id='textBackgroundPreload' style='position:absolute; left:0px; top:0px;'><img width=1 height=1 src='textbackground.png' /></div>
<div id='hourglassPreload' style='position:absolute; left:0px; top:0px;'><img width=1 height=1 src='hourglass.png' /></div>
<div id='background' style='position:absolute; left:0px; top:0px; width:480px; height:272px;'><img src='00006.a' onLoad='elementLoaded();' /></div>
<div id='hotspot1' style='position:absolute; left:8px; top:6px; width:459px; height:255px;'><img id='hotspotImg1' src='transparent.gif' width=459 height=255 onClick='parent.doHotspotClick(1);' onLoad='elementLoaded();' /></div>
<div id='textBackground' style='position:absolute; left:0px; top:245px; visibility:hidden;'><img width=480 height=27 src='textbackground.png' /></div>
<div id='message' style='position:absolute; color:#FFFFFF; text-align:center; left:0px; top:252px; width:480px; height:32px; visibility:hidden'>_</DIV>
<div id='hourglass' style='position:absolute; left:224px; top:104px; visibility:hidden;'><img width=32 height=64 src='hourglass.png' /></div>
</body>
</html>


Where in that does it say what 'frame' this is inside of AM.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Postby Mystery » Wed Apr 15, 2009 9:20 pm

Hmmm, well, it doesn't say so because in the HTML game always the index.htm page is shown. As I said, the other frames are loaded within it.
The images are scrambled into the Alpha Channel Image Data file (.a). On this page you see that it's 00006.a that is displayed :)
If you open that page in your browser you should see which screen it is.

I'm not sure if I understand what exactly the problem is :?
Do you want to tweak the code of the frames apart from adding sounds?
Last edited by Mystery on Wed Apr 15, 2009 9:30 pm, edited 1 time in total.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Wed Apr 15, 2009 9:24 pm

Any way u can open each with browser-- then open with notepad ?

Edit***
Mystery also mentions this..:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Sunny Day » Wed Apr 15, 2009 9:33 pm

mercedes wrote:Any way u can open each with browser-- then open with notepad ?

Edit***
Mystery also mentions this..:D


yep, that does it, double click open each htm page, it then shows you the frame, as in it opens the frame and you look at the picture (though could be confusing if a frame had the same picture).

Mystery - What I'm doing is seeing which .htm page, is which frame, that way you can tell which frame each .htm page is, and copy into it the code to make it play the 'right' music for that frame. You said you can open the .htm page in an editor, notepad for you, crimson editor for me, and look at the code, that in the code it says what frame it is. Then I said, I dont see that in any code at all, so I asked you to show where it is in the code that referances any thing releating to a frame.
Last edited by Sunny Day on Wed Apr 15, 2009 9:36 pm, edited 1 time in total.
Sunny Day
Member
 
Posts: 50
Joined: Wed Nov 26, 2008 1:22 am

Next

Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron