我已经用Adobe动画cc构建了一个html5安卓应用程序,每个东西都能在浏览器上完美运行,但是当我使用phoneGap构建时,我会丢失声音。
请查找附件代码 这是index.js
(function (lib, img, cjs, ss, an) {
var p; // shortcut to reference prototypes
lib.webFontTxtInst = {};
var loadedTypekitCount = 0;
var loadedGoogleCount = 0;
var gFontsUpdateCacheList = [];
var tFontsUpdateCacheList = [];
lib.ssMetadata = [
{name:"index_atlas_", frames: [[0,0,502,800],[0,802,100,111]]}
];
lib.updateListCache = function (cacheList) {
for(var i = 0; i < cacheList.length; i++) {
if(cacheList[i].cacheCanvas)
cacheList[i].updateCache();
}
};
lib.addElementsToCache = function (textInst, cacheList) {
var cur = textInst;
while(cur != exportRoot) {
if(cacheList.indexOf(cur) != -1)
break;
cur = cur.parent;
}
if(cur != exportRoot) {
var cur2 = textInst;
var index = cacheList.indexOf(cur);
while(cur2 != cur) {
cacheList.splice(index, 0, cur2);
cur2 = cur2.parent;
index++;
}
}
else {
cur = textInst;
while(cur != exportRoot) {
cacheList.push(cur);
cur = cur.parent;
}
}
};
lib.gfontAvailable = function(family, totalGoogleCount) {
lib.properties.webfonts[family] = true;
var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
for(var f = 0; f < txtInst.length; ++f)
lib.addElementsToCache(txtInst[f], gFontsUpdateCacheList);
loadedGoogleCount++;
if(loadedGoogleCount == totalGoogleCount) {
lib.updateListCache(gFontsUpdateCacheList);
}
};
lib.tfontAvailable = function(family, totalTypekitCount) {
lib.properties.webfonts[family] = true;
var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
for(var f = 0; f < txtInst.length; ++f)
lib.addElementsToCache(txtInst[f], tFontsUpdateCacheList);
loadedTypekitCount++;
if(loadedTypekitCount == totalTypekitCount) {
lib.updateListCache(tFontsUpdateCacheList);
}
};
// symbols:
(lib.BabykidsLearningStudyMusicalSoundCellPhoneChildrenEducationalToysMobilePhonesLearningToy = function() {
this.spriteSheet = ss["index_atlas_"];
this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();
(lib.lightorange = function() {
this.spriteSheet = ss["index_atlas_"];
this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();
// helper functions:
function mc_symbol_clone() {
var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
clone.gotoAndStop(this.currentFrame);
clone.paused = this.paused;
clone.framerate = this.framerate;
return clone;
}
function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
var prototype = cjs.extend(symbol, cjs.MovieClip);
prototype.clone = mc_symbol_clone;
prototype.nominalBounds = nominalBounds;
prototype.frameBounds = frameBounds;
return prototype;
}
(lib.Symbol6 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Layer 1
this.instance = new lib.lightorange();
this.instance.parent = this;
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
}).prototype = getMCSymbolPrototype(lib.Symbol6, new cjs.Rectangle(0,0,100,111), null);
(lib.Symbol5 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Layer 1
this.instance = new lib.lightorange();
this.instance.parent = this;
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
}).prototype = getMCSymbolPrototype(lib.Symbol5, new cjs.Rectangle(0,0,100,111), null);
(lib.Symbol4 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Layer 1
this.instance = new lib.lightorange();
this.instance.parent = this;
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
}).prototype = getMCSymbolPrototype(lib.Symbol4, new cjs.Rectangle(0,0,100,111), null);
(lib.Symbol1 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_2 = function() {
playSound("Alef");
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).wait(2).call(this.frame_2).wait(2));
// Layer 1
this.shape = new cjs.Shape();
this.shape.graphics.f("#FF0000").s().p("Ah/XBMAAAgjrID3AAMAAAAjrgAj1u2IAAiGIBoAAIg0g7IgXhaQABhhBDhEQBLhKBuAAIBxAPQAXAAAdAPIAACOIgIAAIidgeIhgAWIgeBLQAABLBEAeQBDAsBYAAIBxAAIAACGg");
this.shape.setTransform(11.3,67.3,0.457,0.457);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.f("#FF0000").s().p("Ah/XBMAAAgjrID3AAMAAAAjrgAj1u2IAAiGIBoAAIg0g7IgXhaQABhhBDhEQBLhKBuAAIBxAPQAXAAAdAPIAACOIgIAAIidgeIhgAWIgeBLQAABLBEAeQBDAsBYAAIBxAAIAACGg");
this.shape_1.setTransform(11.3,67.3,0.457,0.457);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape,p:{scaleX:0.457,scaleY:0.457,x:11.3,y:67.3}}]}).to({state:[{t:this.shape,p:{scaleX:0.457,scaleY:0.457,x:11.3,y:67.3}}]},1).to({state:[{t:this.shape_1},{t:this.shape,p:{scaleX:0.902,scaleY:0.902,x:-98.5,y:-195.7}}]},1).to({state:[{t:this.shape,p:{scaleX:0.457,scaleY:0.457,x:11.3,y:67.3}}]},1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(0,0,22.6,134.6);
(lib.button_ta2 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_2 = function() {
playSound("ta2");
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).wait(2).call(this.frame_2).wait(2));
// Layer 1
this.shape = new cjs.Shape();
this.shape.graphics.f("#FF0000").s().p("AgxLXQiFgDiCgTQiigXiVg0QiZgzhzhuQhbhYgrhzQgyiFAAiQQAAh8Aah3IAIgtID2AAIgVDFQgIBZASBWQARBWA4BFQBABOBbAvQBIAlBRARIAqAFQDAAXC9gBQDMgBDMgdQAmgDAmgMQBdgeBOg3QAkgaAjgjQBEhGAUhgQAQhUgGhWQgHhYgThTIgHgjID3AAQAUBqANBfQALBUgIBOQgKBugpBnQgUAyghAvIg0BBQguAyg4AnQg3Amg1AdQg8Ahg+AVQiOAriSASQh3AOh0ADgABvn9IAAjZIDZAAIAADZgAlwn9IAAjZIDZAAIAADZg");
this.shape.setTransform(107.6,72.7);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.f("#FF0000").s().p("AgxLXQiFgDiCgTQiigXiVg0QiZgzhzhuQhbhYgrhzQgyiFAAiQQAAh8Aah3IAIgtID2AAIgVDFQgIBZASBWQARBWA4BFQBABOBbAvQBIAlBRARIAqAFQDAAXC9gBQDMgBDMgdQAmgDAmgMQBdgeBOg3QAkgaAjgjQBEhGAUhgQAQhUgGhWQgHhYgThTIgHgjID3AAQAUBqANBfQALBUgIBOQgKBugpBnQgUAyghAvIg0BBQguAyg4AnQg3Amg1AdQg8Ahg+AVQiOAriSASQh3AOh0ADgABvn9IAAjZIDZAAIAADZgAlwn9IAAjZIDZAAIAADZg");
this.shape_1.setTransform(107.6,72.7);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape,p:{scaleX:1,scaleY:1,x:107.6,y:72.7}}]}).to({state:[{t:this.shape,p:{scaleX:1,scaleY:1,x:107.6,y:72.7}}]},1).to({state:[{t:this.shape_1},{t:this.shape,p:{scaleX:2.341,scaleY:2.341,x:308.3,y:-570.2}}]},1).to({state:[{t:this.shape,p:{scaleX:1,scaleY:1,x:107.6,y:72.7}}]},1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(0,0,215.1,145.5);
(lib.button_ba2 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_2 = function() {
playSound("ba2");
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).wait(2).call(this.frame_2).wait(2));
// Layer 1
this.shape = new cjs.Shape();
this.shape.graphics.f("#FF0000").s().p("AhrLjIAAjYIDYAAIAADYgAgxEgQiFgCiCgVQiegViZg1QiZgyhzhvQhahWgsh1QgyiDAAiSQAAh8Aah4IAIgsID2AAIgVDEQgIBbASBWQARBWA4BFQBABPBbAtQBKAnBPAQIAqAFQDAAYC9gCQDMgCDMgcQAmgDAmgMQBbgdBQg4QAngbAggiQBEhGAUhhQAQhTgGhYQgHhXgThTIgHgjID3AAQAUBqANBfQALBVgIBOQgKBugpBnQgUA0ghAtIg0BAQguAyg4AnQgyAkg6AfQg5AghBAWQiKAqiWATQhwAOh7ADg");
this.shape.setTransform(107.6,73.9);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.f("#FF0000").s().p("AhrLjIAAjYIDYAAIAADYgAgxEgQiFgCiCgVQiegViZg1QiZgyhzhvQhahWgsh1QgyiDAAiSQAAh8Aah4IAIgsID2AAIgVDEQgIBbASBWQARBWA4BFQBABPBbAtQBKAnBPAQIAqAFQDAAYC9gCQDMgCDMgcQAmgDAmgMQBbgdBQg4QAngbAggiQBEhGAUhhQAQhTgGhYQgHhXgThTIgHgjID3AAQAUBqANBfQALBVgIBOQgKBugpBnQgUA0ghAtIg0BAQguAyg4AnQgyAkg6AfQg5AghBAWQiKAqiWATQhwAOh7ADg");
this.shape_1.setTransform(107.6,73.9);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape,p:{scaleX:1,scaleY:1,x:107.6,y:73.9}}]}).to({state:[{t:this.shape,p:{scaleX:1,scaleY:1,x:107.6,y:73.9}}]},1).to({state:[{t:this.shape_1},{t:this.shape,p:{scaleX:2.035,scaleY:2.035,x:21.2,y:-640}}]},1).to({state:[{t:this.shape,p:{scaleX:1,scaleY:1,x:107.6,y:73.9}}]},1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(0,0,215.1,147.8);
(lib.Symbol2 = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Layer 2
this.instance = new lib.lightorange();
this.instance.parent = this;
this.instance.setTransform(-1,0);
this.instance._off = true;
this.instance_1 = new lib.Symbol6();
this.instance_1.parent = this;
this.instance_1.setTransform(49,55.5,1,1,0,0,0,50,55.5);
this.instance_1.filters = [new cjs.ColorFilter(0, 0, 0, 1, 255, 255, 255, 0)];
this.instance_1.cache(-2,-2,104,115);
this.instance_2 = new lib.Symbol4();
this.instance_2.parent = this;
this.instance_2.setTransform(49,55.5,1,1,0,0,0,50,55.5);
this.instance_2.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 127.5, 0, 0)];
this.instance_2.cache(-2,-2,104,115);
this.instance_3 = new lib.Symbol5();
this.instance_3.parent = this;
this.instance_3.setTransform(49,55.5,1,1,0,0,0,50,55.5);
this.instance_3.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 25.5, 127.5, 51, 0)];
this.instance_3.cache(-2,-2,104,115);
this.timeline.addTween(cjs.Tween.get({}).to({state:[]}).to({state:[{t:this.instance}]},1).to({state:[]},1).to({state:[{t:this.instance_1}]},1).to({state:[]},1).to({state:[{t:this.instance}]},1).to({state:[]},1).to({state:[{t:this.instance_2}]},1).to({state:[]},1).to({state:[{t:this.instance}]},1).to({state:[]},1).to({state:[{t:this.instance}]},1).to({state:[]},1).to({state:[{t:this.instance_3}]},1).to({state:[]},1).to({state:[{t:this.instance}]},1).wait(1));
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1).to({_off:false},0).to({_off:true},1).wait(3).to({_off:false},0).to({_off:true},1).wait(3).to({_off:false},0).to({_off:true},1).wait(1).to({_off:false},0).to({_off:true},1).wait(3).to({_off:false},0).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = null;
(lib.FL = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_0 = function() {
/* Stop at This Frame
The timeline will stop/pause at the frame where you insert this code.
Can also be used to stop/pause the timeline of movieclips.
*/
this.stop();
}
this.frame_19 = function() {
this.gotoAndStop(0);
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(19).call(this.frame_19).wait(1));
// Layer 3
this.instance = new lib.Symbol2();
this.instance.parent = this;
this.instance.setTransform(-93,-757.5,1,1,0,0,0,50,55.5);
this.instance._off = true;
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1).to({_off:false},0).wait(19));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = null;
// stage content:
(lib.index = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_0 = function() {
this.stop();
this.button_alef.addEventListener("click", fl_MouseClickHandler_3.bind(this));
function fl_MouseClickHandler_3()
{
this.FL_MC.play();
}
this.button_ba2.addEventListener("click", fl_MouseClickHandler_3.bind(this));
function fl_MouseClickHandler_3()
{
this.FL_MC.play();
}
this.button_ta2.addEventListener("click", fl_MouseClickHandler_3.bind(this));
function fl_MouseClickHandler_3()
{
this.FL_MC.play();
}
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1));
// ت
this.button_ta2 = new lib.button_ta2();
this.button_ta2.parent = this;
this.button_ta2.setTransform(226.8,545.8,0.325,0.325,0,0,0,107.9,72.9);
new cjs.ButtonHelper(this.button_ta2, 0, 1, 2, false, new lib.button_ta2(), 3);
this.timeline.addTween(cjs.Tween.get(this.button_ta2).wait(1));
// ب
this.button_ba2 = new lib.button_ba2();
this.button_ba2.parent = this;
this.button_ba2.setTransform(313.9,558.8,0.325,0.325,0,0,0,107.8,74.1);
new cjs.ButtonHelper(this.button_ba2, 0, 1, 2, false, new lib.button_ba2(), 3);
this.timeline.addTween(cjs.Tween.get(this.button_ba2).wait(1));
// أ
this.button_alef = new lib.Symbol1();
this.button_alef.parent = this;
this.button_alef.setTransform(376.1,528.5,0.805,0.805,0,0,0,11.3,67.3);
new cjs.ButtonHelper(this.button_alef, 0, 1, 2, false, new lib.Symbol1(), 3);
this.timeline.addTween(cjs.Tween.get(this.button_alef).wait(1));
// flash light
this.FL_MC = new lib.FL();
this.FL_MC.parent = this;
this.FL_MC.setTransform(603.2,950.1,1,1,0,0,0,34.4,34.4);
this.timeline.addTween(cjs.Tween.get(this.FL_MC).wait(1));
// BG
this.instance = new lib.BabykidsLearningStudyMusicalSoundCellPhoneChildrenEducationalToysMobilePhonesLearningToy();
this.instance.parent = this;
this.instance.setTransform(49,83);
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(349,563,502,800);
// library properties:
lib.properties = {
width: 600,
height: 960,
fps: 24,
color: "#FFFFFF",
opacity: 1.00,
webfonts: {},
manifest: [
{src:"images/index_atlas_.png", id:"index_atlas_"},
{src:"sounds/Alef.mp3", id:"Alef"},
{src:"sounds/ba2.mp3", id:"ba2"},
{src:"sounds/ta2.mp3", id:"ta2"}
],
preloads: []
};
})(lib = lib||{}, images = images||{}, createjs = createjs||{}, ss = ss||{}, AdobeAn = AdobeAn||{});
var lib, images, createjs, ss, AdobeAn;
这是config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>BabyPhone</name>
<description>
Arabic BabyPhone
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Sameh
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
<icon src="icon.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<!--Android Preferences-->
<preference name="KeepRunning" value="false"/>
<preference name="LoadUrlTimeoutValue" value="10000"/>
<preference name="SplashScreen" value="mySplash"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="InAppBrowserStorageEnabled" value="true"/>
<preference name="LoadingDialog" value="My Title,My Message"/>
<preference name="LoadingPageDialog" value="My Title,My Message"/>
<preference name="ErrorUrl" value="myErrorPage.html"/>
<preference name="ShowTitle" value="true"/>
<preference name="LogLevel" value="VERBOSE"/>
<preference name="SetFullscreen" value="false"/>
<preference name="AndroidLaunchMode" value="singleTop"/>
<splash src="splash_screens/mdpi.png" platform="Android" width="300" height="300" density="mdpi"> </splash>
</widget>