javascript - How to instantiate a Actionscript class that is "movie-less" -
I am a full Flash Nube, and I am trying to create an audio player that uses Flash in the back-end Javascript in Front End, so I do not need the "Movie" capabilities of Flash. I have an encrypted class that plays audio, javascript which tells the epistrip to play, and swiffbags to embed the flash I do not know how to execute the code once the actions are loaded. I have tried Flex and MXML Seeing .. But I'm not sure what I have here.
Audio. AS
package {import flash.media *. Import Flash.net *; Public class audio {public var file: string; Public Var Audio: Sound; Public Channel: Soundchannel; Public function audio (f: string) {file = f; Audio = new sound (); Audio.load (new URLRequest (file)); } Public Function Play (Resume Time: UIT = 0): Zero {if (channel) channel.stop (); Channel = audio.play (resume * 1000 *); } Public function breaks (): zero {channel.stop (); } Public work progress (): number {if (channel = audio.length == 0) back -1; Var p: number = channel.position / 1000; Var l: number = audio. Lambi / 1000; Return P / L; } Time of Public Celebration (): Object {if (! Channel || audio.length == 0) Back {}; Var p: number = channel.position / 1000; Var min: int = p / 60; Var Second: Int = P% 60; Return {"min": minimum, "seconds": sec}; }}}
Javascript:
// create SWF object var flashvars = {}; Flashvars.file = File; Var Params = {}; Params.allowscriptingaccess = "always"; Params.allownetworking = "all"; Var Properties = {}; Attributes.id = "FlashAudio"; Swfobject.embedSWF ("audio .swf", "audio", 1, 1, "9.0.0", false, flashwars, parameters, attributes); Swfobject.addLoadEvent (function () (audio) audio = swfobject.getObjectById ('flash audio');});
I expect how to use external interface I do not know once to run the code, when the SDF loads. Where is the "main" function?
You are only using Sprites mxmlc
.holder Sprite
in audio
category Include.
Package {import flash.display.Sprite; [ASD Public Class Test Sprite (Public Priority: Audio; Audio; Public Function Test (audio);}}}}
By the way, how did the conversation between javascript and flash? If you do not already have it, see the class.
Comments
Post a Comment