Function To Load Video
I'm trying to make a function to load videos at the end of a tween using Tweener but its just not working..
Here's the code the set up the video objects:
Code:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
videoInterfaceMC.videoMC.attachVideo(stream_ns);
Then the function to load the video:
Code:
// Function that loads video into videoMC
function loadVideo(filename:String) {
stream_ns.play(filename);
}
The code to called the function:
Code:
Tweener.addTween(videoInterfaceMC, {_y:780, time:2.5, delay:12, transition:'easeoutcirc', onComplete:loadVideo('video/video.flv')});
I even tried putting the first set of code inside the function.. but that doesn't work either. It doesn't give any errors.. just doesn't load the video. It works fine when I just use stream_ns.play('video/video.flv').. but I want to be able to load different videos.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 04-27-2008, 07:48 PM
View Complete Forum Thread with Replies
Sponsored Links:
I Need To Add A Search Function To My Video Archive
I've created an archive site of about 120 training videos (flv format). The videos are currently accessible from a menu but the end user has to read for a LONG time to find the topic they're looking for.
I'd like to create a search function that will narrow the selection to 3 or 4 videos if possible.
Can someone get me in the neighborhood of where to begin on this?
Thanks for your time,
Matt
View Replies !
View Related
I Need To Add A Search Function To My Video Archive
I've created an archive site of about 120 training videos (flv format). The videos are currently accessible from a menu but the end user has to read for a LONG time to find the topic they're looking for.
I'd like to create a search function that will narrow the selection to 3 or 4 videos if possible.
Can someone get me in the neighborhood of where to begin on this?
Thanks for your time,
Matt
View Replies !
View Related
Function To Stop A Flv Video Playing
Hello there,
i'm a beginner.
i'm trying to call a function to stop a flv video playing.
the function and movieclip is within a movieclip called MovieMenu.
Code:
function stopHim(){
lastPlayer.stop();
new Tween(lastPlayer, "_alpha", none,100,0,15,false);
}
the call is in my main scene, at the release of a button.
Code:
navigation_mc.about_btn.onRelease = function (){
MovieMenu.stopHim();
i think i know what the problem is, but i don't know how to solve it.
MovieMenu is not directly inserted in the project, it's within a scrollarea component. so i guess that's the reason i cannot really access it, correct ?
but how can i fix this? i tried linkage...no good.
i tried to keep it short, if you need more explanation please let me know.
this is the last problem in my site
any help is greatly appreciated.
View Replies !
View Related
Using Variable In Function For FLASH Video
I have a webpage that uses PHP to pull a variable from a MySQL database.
I would like to use that variable to tell my flash component what flash video to play. I cant seem to figure out how to place the variable in the function call to make it work.
Also...The main page is in the root directory of my site with all my flash videos in a subfolder. I can't seem to get the videos to play on my main page unless they are in the same directory. I even tried to simply 'include' the movie into my existing page and it doesn't work.
Any idea on either of these issues?
(Is this even the correct forum area for this? I am new to using FLASH for this stuff)
View Replies !
View Related
Loading Video Depending On Bandwidth Function
Hi
ive found this code to test the users bandwidth and display it, i want to use it to load a different video depeding on their bandwidth.
the thing is that i would rather have it in a function that i pass a path to and it loads the appropriate video
thanks
Code:
onClipEvent(load){
/*
Calculate approximate kbps after test swf loads
*/
function getkbps(startTime,sizeInBytes) {
elapsedTimeMS = getTimer() - startTime; // time elapsed since start loading swf
elapsedTime = elapsedTimeMS/1000; //convert to seconds
sizeInBits = sizeInBytes * 8; // convert Bytes to bits,
sizeInKBits = sizeInBits/1024; // convert bits to kbits
kbps = (sizeInKBits/elapsedTime) * 0.93 ; // IP packet header overhead around 7%
return Math.floor(kbps); // return user friendly number
}
/*
Load test.swf with a unique time to work around browser caching.
Browser will always load a new copy of SWF because url is different each time.
*/
now = new Date(); // create date object
nocacheStr = "?" + now.getTime();
this.loadMovie("test.swf"+nocacheStr);
}
onClipEvent(enterFrame){
// do not execute code until SWF begins to load
if(this._url != _root._url){
if(typeof start == "undefined") {start = getTimer();} // set start time once
if(this.getBytesLoaded() < this.getBytesTotal()){ // not yet loaded
_root.statusmsg = "Checking Bandwidth";
}
if(this.getBytesLoaded() == this.getBytesTotal()){ // swf loaded call getkbps()
_root.statusmsg = "Bandwidth = " + getkbps(start,this.getBytesTotal()) + " kbps";
var bandwidth = getkbps(start,this.getBytesTotal())
if (bandwidth < 200) {
_root.video.loadMovie("50.flv");
} else if (bandwidth < 470) {
_root.video.loadMovie("100.flv");
} else if (bandwidth < 750) {
_root.video.loadMovie("250.flv");
} else {
_root.video.loadMovie("500.flv");
}
}
}
}
View Replies !
View Related
Video Scrub Bar Works, Need To Add One Extra Function
Alrighty - so I have a video player. The player is set up to chain videos: open ad, video segment, ad, end segment (then stop).
During the ads the scrub bar won't show so viewers must watch ad. The video segment the scrub bar shows. The actionscript for the scrubber is as follows:
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
playFlvStream["onMetaData"] = function(obj) {
duration = obj.duration;
};
// ****************************************************************************************************************************************
// Scrub Bar
// ****************************************************************************************************************************************
function videoStatus() {
vPlayerHMC.vidPlayer.amountLoaded = playFlvStream.bytesLoaded / playFlvStream.bytesTotal;
loader.loadbar._width = amountLoaded * 104.8;
loader.scrub._x = playFlvStream.time / duration * 104.8;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,105,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
playFlvStream.seek(Math.floor((loader.scrub._x / 105) * duration));
}
Now what I need to do is to have the scrub bar not allow a user to scrub to the end and trigger the next video. The current scrub bar allows a user to scrub to the end, which is 100% bytes total and then the AS fires off a control so that the next video loads. The video needs to be able to play fully, whether or not a user scrubs to the very end. In other words, allow them to move the scrub bar to the end...but if the video duration is not = 100% don't do anything. If it = 100% then the video segment has ended and get the next video to load and play.
My thought was to write something either based on bytesTotal or possibly the videoInterval var.
Any suggestions?
View Replies !
View Related
Video Paused When Loading Via NetStream Object Within A Function
Hi,
I'm having a problem loading an FLV file via the NetStream object.
The following is on frame 1 of my root timeline:
Code:
loadMovieClip();
function loadMovieClip():Void {
// Create new NetConnection object
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
// Create new streaming object and attach the NetConnection object
var netstream:NetStream = new NetStream(netConn);
_root.bgVideo.attachVideo(netstream);
netstream.setBufferTime(5);
netstream.play("champcrash.flv");
netstream.onStatus = function(infoObject:Object) {
trace("NetStream.onStatus called: ("+getTimer()+" ms)");
for (var prop in infoObject) {
trace(" "+prop+": "+infoObject[prop]);
}
trace("Loaded: " + this.bytesLoaded);
trace("bytesTotal: " + this.bytesTotal);
trace("");
};
};
Nothing too complicated there... its just loading 'champcrash.flv' into the 'bgVideo' object on the stage. My problem is that with the code as above, the video is paused on the first frame, and doesn't progress.
The odd thing is, if I take the contents of the 'loadMovieClip' function, and just place it on the same frame, without any function or function call, then the video will play correctly, without pausing. Code looks like:
Code:
// Create new NetConnection object
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
// Create new streaming object and attach the NetConnection object
var netstream:NetStream = new NetStream(netConn);
_root.bgVideo.attachVideo(netstream);
netstream.setBufferTime(5);
netstream.play("champcrash.flv");
netstream.onStatus = function(infoObject:Object) {
trace("NetStream.onStatus called: ("+getTimer()+" ms)");
for (var prop in infoObject) {
trace(" "+prop+": "+infoObject[prop]);
}
trace("Loaded: " + this.bytesLoaded);
trace("bytesTotal: " + this.bytesTotal);
trace("");
};
The code is EXACTLY the same, except it isn't within a function, yet the latter example plays the video correctly, and the first example doesn't.
This is driving me crazy... any suggestions??
thanks,
Marcus.
View Replies !
View Related
Load VIDEO Help
Is there a way to load an external video file like you would load external movie?
I have several .avi files I want to show in a single flash movie. I don't want to embed them because Flash makes the .avi 4x the original file size when embedded.
View Replies !
View Related
Can I Load A Video Using
loadMovie, and the movie i am loading is a video that i have imported into the fla
,made an swf of it and now i want to load and play it!
is it possible?
if not is there any other way?
beacuse if i have 100 movie s to show i can't make an swf that weight's 100 MB!
thanks in advance
peleg
View Replies !
View Related
Load Video
can a flash movie load a video? i have a folder on my site with several wmv video files on it and i wanted to make a single page to play them all. There were a few things i was wondering if could be done. i wanted the flash movie be on a page "/video/video.html" and to load videos from the same directory. So when i goto like "mysite.com/videos/video.html?VideoOne" it loads "VideoOne.wmv" and if possible, load "VideoOne.jpg" which is a small screen shot.
I know this is a little much for a newbie, but although im new to flash programming, ive been doing other sorts of poramming for years and im sure if i had an example or something to work off of i could put this together myself.
all i need to know is:
How to split a string(get "VideoOne" from "mysite.com/videos/video.html?VideoOne"
How to add it to another string(Take "VideoOne" and make it "mysite.com/videos/VideoOne.wmv)
and How to load a movie from a URl
-thanks for any help you can give me
View Replies !
View Related
[F8] Load Video Via Txt
Hello
i have made a presentation where all images and text are loaded via a .txt file, and now i want to do the same with my videofiles.
Is it possible to load a video via txt file?
and how do i do that?
bentejente
View Replies !
View Related
Video Load Help
i'm having a problem loading .swf files on my flash page. the main page loads and the links are supposed to load new swf files within the page, but they don't load. this is my code for the buttons
quote:on (release) {
_root.action.loadMovie("page2.swf");
}
the wierd thing is, it works fine on my computer...but when i put the videos on my web server, the main page loads but the other "sub pages" don't work...why????
thanks
View Replies !
View Related
Load.XML Function
Hi, i'm newbie in flash actionscripting. Here is my problem,
myxml.load("test.xml"); - loads xml file, but what should I put instead of test.xml, to load xml defined in HTML file? and what should i put in html? like param name, or something?
10x
View Replies !
View Related
Load Function
Hi,
How would I load this function from my Graphic Function.As file into the main root
function displayDynamicGraphic (instanceName,xcoord,ycoord, path )
{
var nextDepth:Number=this.getNextHighestDepth();
_root.createEmptyMovieClip(instanceName,nextDepth)
target._x=xcoord;
target._y=ycoord;
instanceName.loadMovie();
}
Any help much appreciated
Chris
View Replies !
View Related
Help With Load Function
I am having trouble with my loading function. I tried a lesson and it is not working. I know my movie is large enough too, to have one.
Does anyone know and good lessons that could help me with this.
PS how can you cut down the size of the .swf file
Thanks Mike
View Replies !
View Related
How Do They Get The Video To Load So Fast
http://www.martiniracing.com/content/home.asp
I tried to make a similar page with video, two small video clips in the intro/header like this one, but my header took forever to load even though the two clips were only about 6 seconds each. Any idea on how to streamline the video clips?
View Replies !
View Related
Can Anyone Load This Video Into Flash For Me?
I have a client who insists on using wmv files.
The problem is that I can't load it into Flash.
If someone could do this for me I would pay them about $40 for 13 videos.
I would want to fla file and the html file and the swf.
But for now, just try to do this one:
http://www.caillouette.com/c1.zip
thanks
View Replies !
View Related
[F8] Load Random Video
Hello.
I have a swf which loads a random video out of 5 every time it loads:
Code:
var total= 3;
video_flp.contentPath= "videos/"+random(total)+".flv"
My question is how do I do it so that after the random video loads so that in continues playing the following videos being loaded from an external xml.
View Replies !
View Related
Load Video From Memory
Hi,
i know my question is somehow special... :-)
I have the binary data of a video file (flv) in a byte array in memory.Is there any possibility to play that video?
With image files and swf's this is easily possible using the loadBytes method of flash.displayLoader.Loader.
I even thought about subclassing NetStream, but could not find any information how the Video class gets the binary data from the NetStream class
Thank you for any help,
Thomas
View Replies !
View Related
[MX] Load External Video
Can someone give me a step by step tutorial on how to create an empty mc and then use actionscript to load a .avi into it. The .avi is in the same folder as the movie...so the coding for that piece, I hope, shouldn't be complicated
View Replies !
View Related
How Do I Load Video In Flash 6?
I am trying to stream or progressive load a video named reel.flv in a movie clip because I want it to play in that area of the screen. What is the command to play video in this movie clip? The movie clip is in the same directory as the .swf file. I have Flash 6.
View Replies !
View Related
NetStream Load Video Help
I have made an flv player using Net stream that is in its own swf. What I am trying to do is externally load this flv player into a movie clip and then depending on a users choice of video change the video within the external video player.
in the video player i have set the net stream to play what is in the variable
ActionScript Code:
ns.play(videoP);
So when I load the player into a movie clip i can change the var with a different path to play,
the AS that i am using in the MC is
ActionScript Code:
videoP = "video/mod1_vid2.flv";
trace(videoP);
newvideo_mc.loadMovie("videoPlayerm1.swf");
my problem is the var is changing to the correct file location, confirmed by trace, but is not changing the videoP var in the player
Any ideas completely stuck
NB: am i right in thinking that a variable can be accessable to external and internal swf?
View Replies !
View Related
Load Video From Memory
Hi,
i know my question is somehow special... :-)
I have the binary data of a video file (flv) in a byte array in memory.Is there any possibility to play that video?
With image files and swf's this is easily possible using the loadBytes method of flash.displayLoader.Loader.
I even thought about subclassing NetStream, but could not find any information how the Video class gets the binary data from the NetStream class
Thank you for any help,
Thomas
View Replies !
View Related
FLV Video Pause On Load
Hello,
Can someone please offer some assistance. I currently have a video file in my timeline which is being called using the Netstream Connection. Once the video has been buffered, I would like it to stop on the first frame, and only start when the user hits the play button. Can someone please tell me how this is done? I have looked everywhere and cannot find the answer.
Thanks in advance,
Oliver Alexander
View Replies !
View Related
FLVPlayback Video No Load
I have an AS2 interface that loads both .flv videos as well as external swfs. When I test the project locally it works 100%. When I upload the interface, with all of the external files as appropriate, the .flv videos do not display.
My issue is not the MIME type on the server, as I have hundreds of other .flv videos on the same server being hosted without a problem. I know the pathing is correct, as all of the external .swfs load correctly, and they use the same variables for pathing, plus I have the path echoing out to a dynamic text box for debug purposes. Everything is getting set correctly, the MIME type is correct, but the videos do not load nonetheless. Again, locally it works 100% of the time. What other things can cause this to happen?
View Replies !
View Related
Load Video Into Loaded Swf
I've set up a test file and I'm having big problems loading a video file from within a loaded movie.
I have 3 files - "base.swf". This loads a swf - "LoadVideo.swf" into level 10
loadMovieNum("Files/videoFiles/LoadVideo.swf",10);
This, ("LoadVideo.swf"), has a button with the code
loadVideo_mc.onRelease = function() {
level10.loader_mc.loadMovie("Video.swf");
}
This third file - "Video.swf" is called from "loadVideo.swf" above and lives in the same folder. The file reference in the content path of the component skin reads:-
Files/videoFiles/clip123.flv
The video loads OK, but the component skin does not.
Has anybody any ideas as to why this isn't working? I've been working for ages on this and I would really appreciate some help. Thanks in advance.
Here is a link to the zipped folder.
download zipped folder
Please ignore the attached code below. I don't know how to get rid of it.
Attach Code
loadMovieNum("Files/videoFiles/LoadVideo.swf",10);
Edited: 02/01/2007 at 06:19:59 AM by P Priddle
View Replies !
View Related
Cannot Load External Video
Hi, im tryin to load a video FLV into my swf using the following code -
vid_btn.onRelease = function () {
myVideo_nc = new Netconnection ();
myVideo_nc.connect(null);
newStream_ns = new NetStream(myVideo_nc);
videoHolder.build.flv(newStream_ns);
newStream_ns.play("build.flv);
};
where Video holder is my embedded video symbol and the button to play it is called vid_btn .. its from a book and i still cant follow it !
thanks
View Replies !
View Related
Help With Video Load Or Player
hi i am fairly new to flash with very little knowledge of AS but catching on. i am trying to make an external video play within my flash site. i cant seem to get it to work. i have about ten videos and would like to make a list where people can simply click the title of the video and it plays on the scren within flash. here is a look at my site currently. any help would be very much appreciated! thanks
Jason
http:www.hecticfilms.com
View Replies !
View Related
How Do I LOAD A Video Into Flash?
simple question.
would like to know the AS code to load an external video, say quicktime or something else, into a specific frame of my fla.... and have it visible in the website.
I'm thinking of putting in videos that are 792 x 396 pixels... What I would like to know is can an acceptable quality be viewed at this size keeping actual file size of the video as low as possible. The videos are basically monochromatic for the most part... are of me sketching on paper ... and my have some images displayed with voice-over...oh yeah.. the videos will all have a constant narration. Total video time (30 sec to 1 min)
Any help appreciated.
Thanks
View Replies !
View Related
How To Load Video To A MovieClip
Hi,
I have multiple movieclips(thumbnails) inside a movieClip "thumbs_mc" which looks like a scroller. In those multiple movieClips, I am loading jpgs using movieClipLoader.loadClip method, and URLs for these jpgs are coming from an xml file,
My problem is that those list of URLs can also have flv video URl, and i want a thumbnail of video on those places, I know how to create thumbnail of a video. Problem is that i am not able to attach that thumbnail to that movieclip which should hold the thumbnail, as loadClip method allow only jpg, gif and swf files, not flv.
i tried
thumbs_mc["mc"+j].attachMovie("videoClip", "videoThumb",j);
here videoclip is a movieclip in a library with linkage id set to "videoClip", and videoThumb is
my video. There might be some other way. because when i searched i found only movieclip attaching to another movieclip using this.
I'll be grateful, if anyone can help me on this.
View Replies !
View Related
Cannot Load External Video
Hi, im tryin to load a video FLV into my swf using the following code -
vid_btn.onRelease = function () {
myVideo_nc = new Netconnection ();
myVideo_nc.connect(null);
newStream_ns = new NetStream(myVideo_nc);
videoHolder.build.flv(newStream_ns);
newStream_ns.play("build.flv);
};
where Video holder is my embedded video symbol and the button to play it is called vid_btn .. its from a book and i still cant follow it !
thanks
View Replies !
View Related
Load Video From Memory
Hi,
i know my question is somehow special...
I have the binary data of a video file (flv) in a byte array in memory.Is there any possibility to play that video?
With image files and swf's this is easily possible using the loadBytes method of flash.displayLoader.Loader.
I even thought about subclassing NetStream, but could not find any information how the Video class gets the binary data from the NetStream class
Thank you for any help,
Thomas
View Replies !
View Related
Video Load Time
I have Flash MX(version 6).I have a video that i want to put into flash. right now the video is internal and when i export it out to a webpage, it takes a long time to load when viewed on the internet. Is there a way to play the video through a movie clip externally so that the movie load time will be quicker?
Also, if so, when the movie gets done playing, can i have flash to go another frame?
Please let me know.
Thanks,
View Replies !
View Related
LoadMovie Function Does Not Always Load
Hi, I've set up an array with flash file names in it, and a button to load the flash file using .loadMovie to an instance of movie clip on stage. The problem is that the button doesn't always load the flash into the instance correctly and, when it doesn't it destroy the old movie and went blank onthe instance. No more flash can be load on the instance after that. This usually happen when I click on the "Next" or "Previous" button to quickly. Will adding a pre-loader in the instance be the way to avoid it? Anybody
View Replies !
View Related
Load Movie Function
Hi,
I downloaded a flash project of the net and I'm trying to make some simple changes to it. There is a panel that goes down the right side of the screen with a button on it. Everything is in flash. I would like to add more buttons to this panel. When you click on the button that is already there text appears to the left of the panel. How do I duplicate this button and add the appropriate code to launch different text.
Here is the script for the first button. What is the "2"?
on (release) {
gotoAndPlay(2);
}
All I need is another button that when clicked opens a new text block, but I don't want to create another swf for this to happen.
If you could offer any help I would greatly appreciate it. It's been a problem I've tried to solve for 2 days.
Thanks,
TexanFlash
View Replies !
View Related
A Function To Load Movie (swf)
I want to write a function that will load movie when I click on the buttons from the menu. For example, I have a menu with four buttons and four movies with the name m1a1, m1a2, m2a1 and m2a2.
The main purpose for this function is I only have to call the function instead of write the same action script agains for four time.
So, what should i do to solve the preolem and I hope some could help me. Thanks.
View Replies !
View Related
Load Movie Using Function
Hello, I have tried to load movie on clicking button from the menu. When i click on button 1, it will load movie m1a1.swf, button 2 will load movie m1a2.swf and so on.
But, the problem is nothing was loaded when i clicked on the button. So could anyone help me check the code for me?
View Replies !
View Related
Waiting For SWF To Load Within A Function
Hi all,
Im trying to load a number of exteran SWF files within a for loop. I then need to get the width of the movie clips after they recieve the loaded data all within the same function. How do i get the function to wait for each SWF to load within th e for loop?
the code would look something like this:
loadLayers = function(){
for(x=0;x<_level0.mydata.nol;x++){
canvas.myLayers["layer_"+(x+1)].loadMovie("something.swf");
//wait for SWF to load
trace(canvas.myLayers["layer_"+(x+1)]._width);
}
}
At the moment, i can only get the _width property after a short amount of time even on my local machine as the entering SWF's though pretty small (1-2KB) still take some time to load. Id like to wait for the SWF to load before checknig the _width, even if it means putting the trace script within a 2nd function that gets triggered once the corresponding SWF loads.
Any ideas?
Thanks so much
View Replies !
View Related
Function And Load Movie
On the first frame of the maintimeline I have the following code...
First I declare a variable...
var course_name = "language_arts";
Then I define a function with 1 parameter...
function teaching_question_button(problem_number) {
loadMovie(course_name+"/problem"+problem_number+".swf", "_root.problem_movie_clip_holder");
}
On a button on the main time line I call the function and pass a parameter..
on (press) {
_root.teaching_question_button(001);
}
This wont work any ideas?
View Replies !
View Related
Function Load Order
hi guys
i haven't posted here for a while but i've come across a problem that you might be able to answer
here is my script
PHP Code:
// ActionScript Document
XML.prototype.ignoreWhite = true;
menuItems_array = [];
//function to load the Menu Items
function loadMenu(XMLDoc) {
//set default paths
var textFilesPath = "./updateable_files/";
var sectionImagesPath = "./images/sectionimages/";
//get content
XMLVars = new XML();
XMLVars.onLoad = function(success) {
if (success) {
trace("success");
_root.description.htmlText = "<b>Loading content...</b>";
for (var i=0;i<this.firstChild.childNodes.length;i++) {
//set variables from XML
var thisKind = this.firstChild.childNodes[i].attributes.kind;
var thisText = this.firstChild.childNodes[i].childNodes[0].childNodes[0].nodeValue;
var thisDescription = this.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
var thisSectionImage = this.firstChild.childNodes[i].childNodes[2].childNodes[0].nodeValue;
//object to store starting attributes for menuItem
var tempObject = new Object();
tempObject.menuItem_txt = thisText;
tempObject.description = textFilesPath + thisDescription;
tempObject.description_txt = "copy to be replaced";
tempObject.sectionImage = sectionImagesPath + thisSectionImage;
tempObject._y = 13 * i;
_root.menu.attachMovie("menuItem_clip", thisKind, i, tempObject);
//add item name to array
_root.menuItems_array.push(thisKind);
}
trace (_root.menuItems_array);
} else {
_root.description.htmlText = "<b>Error loading menu</b>";
}
}
XMLVars.load(textFilesPath+XMLDoc);
trace(textFilesPath+XMLDoc);
}
//function to load the description_txt files in
function loadDescriptions() {
trace (_root.menuItems_array.length);
for (var i=0; i<_root.menuItems_array.length;i++) {
trace (i);
}
}
and i call the functions like this
PHP Code:
loadMenu("menu.xml");
loadDescriptions();
but when i run this it runs in a really wierd order:
./updateable_files/menu.xml ---->trace after XMLVars.load in loadMenu()
0 ---->trace in loadDescriptions()
success ---->trace in loadMenu() -> XMLVars.onLoad
news,about,how,projects,contact,vacancies,login ---->trace after for loop in loadMenu()
so even though the loadMenu() is called and runs first, loadDescriptions() still runs before the XMLVars.load within loadMenu() ?
is there a way i can force the whole of loadMenu() to run before loadDescriptions ?
View Replies !
View Related
Load Movie Function
HI - I'm puzzled over a simple thing:
My main movie loads movie2.swf into an empty movieclip (named: "loader")
Movie2 has this code in it:
this.onLoad = onThisMovieLoaded;
function onThisMovieLoaded() {
BookInfo.loadMovie("Info.swf");
// Begin XML process
loadBooks();
}
function loadBooks() {
var booksXml = new XML;
booksXml.ignoreWhite = true;
booksXml.onLoad = onModelsXmlLoaded;
booksXml.load("http://localhost/catalog/authors.aspx");
}
(more code follows ...)
My problem is that my main movie loads movie2, but the XML data does not get loaded into movie2. It works fine when published by itself, but does not show the XML data when loaded into the main movie.
Could it be because of this on the first line: this.onLoad = onThisMovieLoaded;
What can I do to solve this?
Please HELP!! Thanks in advance ...!
View Replies !
View Related
|