Hi , here i have a situation that i’ve been working on for a long time.
Here is the situation:
http://www.monov.net/technoboxe
This is a contract i have that i need to finish soon hehe…My problem is my poor knowledge in flash. This version is working but has problems and is not scripted correctly.
Right now im my new template i have a blank actionscript 3 file. on the main timeline on the first frame i load 3 things in my “mastermc” Movieclip (that i’ve hand created on the stage). I first load the background , then i create an empty movieclip that will contains the .flv later , and then the menu. This is my script:
import technotest;
var bgLoader:Loader = new Loader();
mastermc.addChildAt(bgLoader,0);
var bgURL:URLRequest = new URLRequest("background.swf");
bgLoader.load(bgURL);
var vidmc:MovieClip = new MovieClip();
mastermc.addChildAt(vidmc,1);
var menuldr:Loader = new Loader();
mastermc.addChildAt(menuldr,2);
var menuURL:URLRequest = new URLRequest("menutest.swf");
menuldr.load(menuURL);
Then i have a my menutest.swf that contains a short script for each button you find
(Basepos , Jab , Direct , etc…)
When you hit a button this is what is happening example for the jab:
import technotest;
var par:Stage = Stage(this.stage);
function JabDfn(event:MouseEvent):void
{
gotoAndStop(1);
var newclass:technotest = new technotest;
newclass.addvideo(par, "Jab", "toto.mp3");
}
Alright so here i just send a request in my .as file to the addvideo function referring the stage , the name of the anim it has to load and the mp3 (temporary as you can see).
So in my .as file:
package
{
import flash.events.NetStatusEvent
import flash.net.NetConnection
import flash.net.NetStream
import flash.media.Video
import flash.net.URLRequest
import flash.media.Sound
import flash.media.SoundChannel
import flash.media.SoundTransform
import flash.display.*
public class technotest extends MovieClip
{
public function addvideo(mystage:Stage, thevid:String, themp3:String):void
{
var loopnum = 1
var loopmax = 2
var par:MovieClip = MovieClip(mystage.mastermc);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = new Object();
ns.play(thevid + "Normal.flv");
var vid:Video = new Video(640, 480);
vid.attachNetStream(ns);
par.vidmc.addChild(vid);
ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
//-------------------Loop here don't mind about it----------------------
function netstat(stats:NetStatusEvent)
{
if(stats.info.code == "NetStream.Play.Stop") {
if(loopnum <= loopmax) {
ns.seek(0);
loopnum = loopnum + 1
}
else
{
if (loopnum != 999) {
ns.play(thevid + "Slowmo.flv");
loopnum = 999
}
}
}
}
//------------------------------------------------------------------------
//---------------------Sound play here------------------------------------
var soundRequest:URLRequest = new URLRequest(themp3);
var sound_:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var transform1:SoundTransform = new SoundTransform(1, 1);
sound_.load(soundRequest);
//soundControl = sound_.play();
//------------------------------------------------------------------------
}
}
}
Now these are my problems:
First of all , ive been trying to add the .flv to the vidmc MovieClip , created on my timeline on the sage (first frame) but it seems like it can’t find it.
I really need to make sure the video is UNDER the Menu. Because it is fine on the site now but with the clean scripting i can’t just make it happen. Thanks in advance!