Sequential FLV Playback With JavaScript
Okay I've been searching for this answer for awhile, I've seen a bunch of people ask the same question but haven't seen an answer so I'm going to try again cuz I'm losing hair over it.
I'm loading FLV's into a container SWF via JavaScript using netconnection.
On NetStream.Play.Stop I'm making an External Interface call to a JS function which then calls back to the SWF with a new FLV movie.
This causes a stutter between the two movies, as this is animation it's unacceptable.
I've also tried NetStream.Buffer.Flush but that event fires a bit too soon causing the next video to cut off the end of the video that is playing.
Here's a sample of the code. Any ideas?
ActionScript Code:
function newflvmovie(movie)
{
videoHolder.x = -15;
stage.addChild(videoHolder);
videoHolder.attachNetStream(newStream);
newStream.play(movie);
videoplaying = true;
newStream.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
newStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
}
function statusHandler(myevent:NetStatusEvent)
{
if (myevent.info.code == "NetStream.Play.Stop")
{
stage.removeChild(videoHolder);
newStream.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
newStream.removeEventListener(NetStatusEvent.NET_STATUS, statusHandler);
if (videoplaying)
{
videoplaying = false;
ExternalInterface.call("movieComplete");
}
if (idle)
{
ExternalInterface.call("resetIdle");
idle = false;
}
}
}
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 01-13-2009, 05:26 PM
View Complete Forum Thread with Replies
Sponsored Links:
Sequential MovieClip Instances Playback
3 Movieclips(instance of each other) on stage named as follows
mcClip1, mcClip2, mcClip3
These clips are stopped on their first frame and contain the same animation on the next frame.
How do I start the first one and not play the others until the first one reaches a certain frame in its movieclip? And than not play the second one until it reaches the certain frame.
View Replies !
View Related
Synchronize Video Playback With Image Playback
Hey guys, I was wondering how can we synchronize a video playback with an image slideshow, what I would like to achieve is to have the image slideshow playback follow the sequence of a video playlist, so supposing I have item 1(a video) playing I would want the item 1(image) show up for the duration of the video and change to the following image when item 2(video) starts playing.
Any ideas? Should I have one playlist for both videos and images or two seperate playlists, one for video and one for images?
I'm open to suggestions as long as i can get the image playback to follow the video playback.
Thanks in advance.
View Replies !
View Related
Sequential FLV's
This 'seems' simple enough but it isn't. I have one 9 minute movie I produced and need to get in on the net for a few people to view. A streaming server is not an option. So I broke up the movie into six part and rendered each then converted them into six FLV's.
Using NetConnection and NetStream how do I ge these to play in sequence? I can't seem to discover how to tell when the first FLV is finished so I can play the second, etc. Does anyone have a valid search term or tutorial or code snippet to make this work?
Thanks!
View Replies !
View Related
Sequential Loadmovies
I have an animation as the base movie, and I'm trying to have it stop in certain places and load another swf, play it, then continue with the base movie, until it reaches the next stopping point, loads a movie, plays, and continues with base movie once again.
Basically I just need to know how to start the next load movie after I have played through the 1st load movie once.
Code:
frame1: loadMovie ( "loadme.swf", 3 );
frame3: _level3._x = 220;
_level3._y = 140;
stop();
And if you have even more time to answer, is there a way to limit the size of the movie loaded. By size I mean x pixels by y pixels big, no matter how big/small the original movie was made in. Kinda like an autofit.
Thanks
View Replies !
View Related
Sequential Preloader Help Please
I am trying to develope a slideshow that will pull in external jpegs but I want to preload the images before the slideshow starts. I would like to figure out a way I can show the non-broadband users a progress bar for the TOTAL of all of the images.
The number of the images are variable (pictotal)
This is how I am loading them
code: for (i = pictotal - 1; i != 0; i--)
{
this.createEmptyMovieClip ("pic" + i, pictotal - i);
//place the image off the stage so it doesn't slow down
this["pic" + i]._x = -300;
this["pic" + i]._y = -300;
this["pic" + i]._alpha = 0;
_global.count = pictotal;
this["pic" + i].loadMovie ("http://www.startribune.com/style/news/graphics/slideshow/netfish/" + i + ".jpg");
}
Thanks!
View Replies !
View Related
Sequential Tweens Via AS?
Hello, I'm a newbie to actionscript. I'm trying to learn how to control movie clips a little better via Actionscipt.
That effect that I'm trying to get are sequential tweens with AC. Let say I have H-e-l-l-o and applied AC to each letter. I can get the letters to tween all at once but how do I control when each letter tweens?
This is a the script I have so far.
onClipEvent (enterFrame){
if (_root.ball_mc._xscale < 200, _root.ball_mc._yscale < 200){
_root.ball_mc._x = 1;
_root.ball_mc._y = 1;
_root.ball_mc._xscale += 50;
_root.ball_mc._yscale += 50;
}else {
_root.ball_mc._x = 1;
_root.ball_mc._y = 1;
_root.ball_mc._xscale -= 100;
_root.ball_mc._yscale -= 100;
}
}
I have a feeling I have to pass a function to the other letters. How do I do that? Thanks.
View Replies !
View Related
Help Sequential Anim AS
hi, i'm a newbie in AS.
I work in Flash MX 2004. I experiment with an effect: in a MC (rectangle_mc) i create an anim (rectangleAnim_mc), and using AS to place multiple rectangle_mc in stage forming a matrix 7x5 (total of 35 elements); ok, i try to play the rectangleAnim_mc in sequential, like a wave, like rollover the mouse over the AnimMC, but i didn't achieve this. I try to insert a time delay, setInterval, but don't work.
The stage is 700x500. The sequential anim execute when release a button.
First frame in Actions layer:
Code:
xpos = new Array(0,100,200,300,400,500,600);
ypos = new Array(10,90,170,250,330);
k = 0;
function createRec () {
for (i=0; i<=6; i++) {
for (j=0; j<=4; j++) {
_root.attachMovie("rectangle_mc", "rectangle_mc"+i+j, k);
indRec = _root["rectangle_mc"+i+j];
indRec._x = xpos[i];
indRec._y = ypos[j];
k++;
}
}
}
createRec();
function recAnim1 () {
for (i=0; i<=6; i++) {
for (j=0; j<=4; j++) {
indRec = _root["rectangle_mc"+i+j];
_root.indRec.rectangleAnim_mc.gotoAndPlay("all");
//-> in this line i try to insert a delay
}
}
}
The button:
Code:
on (release) {
recAnim1();
}
Please help. Excuse my english
View Replies !
View Related
Sequential Animation.......
Hi,
I have the following code to play animations titled "idle1","idle2"....."idle6" where idle1, idle2....... are frame labels respectively. The animations are playing randomly but i want them to play sequentially. pls help........
if (time>3) {
n = "idle" add (random(6)+1);
tempX = _root.helper._x+random(200)-100;
tempY = _root.helper._y+random(200)-100;
if (tempX<60) {
tempX = 60;
}
if (tempX>710) {
tempX = 710;
}
if (tempY>430) {
tempY = 430;
}
if (tempY<-300) {
tempY = -300;
}
if (n == "idle5") {
_root.notPresent = true;
_root.texttime = 20;
_root.text = "
Double click me ";
if (tempX>630) {
tempX = 630;
}
_root.targetx = tempX;
_root.targety = tempY;
_root.action = "speak";
_parent.gotoAndStop("speak");
}
if (n == "idle6") {
_root.slideshow();
if (tempX>630) {
tempX = 630;
}
}
_root.targetx = tempX;
_root.targety = tempY;
_root.action = n;
}
View Replies !
View Related
Sequential FLV Playlist
Hi, am currently using netstream/netconnection to playback a series of short flvs through a video component.
I'm currently loading one video, and then letting the user select a new video from a column of buttons at the side of the movie.
How can I go about creating a playlist so I can playback the videos sequentially, whilst still being able to select a new video from the side column of buttons?
I've looked at Lynda.com's tutorial into playing back FLVs sequentially using the list component and XML, however, I wish to use buttons rather than a list populated by XML.
So, to recap, how can I playback, let's say 3 flvs sequentially whilst being able to change the currently playing video using buttons?
All advice is much appreciated.
Thanks,
DigiPencil
My progress thus far:
www.dedicatedmicros.com/ukftp/FLVHUB/hub.html
View Replies !
View Related
Sequential Functions
Hi,
I've got a flash movie that loads external swfs into a container upon button clicks. Each button feeds a function called 'getSection' with a string called 'section'.
I want it to:
1. Fade out the container,
2. Once faded, load the movie and display the loader
3. Once loaded, fade the container back in.
I intend to keep the functions I have defined below and have created a fadeMovie function that I found to be particularly useful.
The trouble is that the all of the functions fire at the same time, and I can't figure out how to seperate them. I've trued having the fade function return true when faded or false when still fading, but I've either handled it incorrectly or completely missed the point.
I've been using flash casually for years, though this is the first attempt I've had at scripting a movie solely through it's first frame. I intent to cut back the processes running on my websites through the use of too many simultaneous onEnterFrames and if statements as listeners.
This is the first time I have posted on any development forum as it's the first time I haven't been able to find my own solution. I have no idea what to search for. Every other time documentation or Google -and, through Google, Actionscript.org - has done the trick.
Code:
// Prepare load and transition
function getSection(section:String) {
fadeMovie(sectionCont, 0);
loadMovie(section.toLowerCase()+".swf", sectionCont);
displayLoader();
fadeMovie(sectionCont, 100);
}
// Fade object
function fadeMovie(fadeMC:MovieClip, alphaTo:Number) {
fadeMC.onEnterFrame = function() {
fadeMCalpha = Math.round(fadeMC._alpha/5)*5;
if (fadeMCalpha<alphaTo) {
fadeMC._alpha += 5;
return false;
} else if (fadeMCalpha>alphaTo) {
fadeMC._alpha -= 5;
return false;
} else {
fadeMC._alpha = alphaTo;
delete fadeMC.onEnterFrame;
return true;
}
};
}
I would greatly appreciate any help I can get.
View Replies !
View Related
Sequential Loader Using Xml
Hello guys Im haveing a issue with my loader class, I'm trying to load my images when one completely loads, and then the next will load etc.. Anyways heres my issue that I'm haveing when i publish my swf i get a compileing error stateing.
TypeError: Error #1010: A term is undefined and has no properties.
at main_dynamic_fla::MainTimeline/done()
I believe its how the display list works, I'm still new to the actionscript 3.0. Please help thanks I have uploading my files using senduit.com.
Here is the url where its located!
http://senduit.com/6a71e2
thanks
abel gudino
View Replies !
View Related
Sequential Preloader
Hi,
I am getting very frustrated trying to finish off my sequential preloader.
The problem is that it works absolutely fine when the site is accessed through a mac but fails when a pc user tries.
Basically I have a movie that loads itself before preloading 5 submovies. The submovies are loaded into a target clip with the instance name 'container' The script to o this is below. What it does is the following: It duplicates the container clip and renames it container1, 2, 3, 4, 5 and then loads a movie phase1, 2, 3, 4, 5 respectively. The script will only perform this sequence (duplicate, load, loadNext) only once the previous movie has finished loading.
Here is the script:
The container clip has the following attached to it:
onClipEvent (enterFrame) {
if (_root["load"+this._name]) {
if (total_bytes == null) {
total_bytes = this.getBytesTotal();
} else {
// controll bar - standard % preloader code
loaded_bytes = this.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
loadBarnum = int((loaded_bytes/total_bytes)*211);
setProperty("_root.loadbar", _width, loadBarnum);
_root.percent = int((loaded_bytes/(total_bytes+1))*100) add "%";
if (percent_done == 100) {
_root["load"+this._name] = false;
_root.loadNext();
}
}
}
}
The clip is in a frame with the following script:
// initialize counter variables
count = 0;
// how many movies are we going to be loading?
numMoviesToLoad = 5;
// define our loadNext function
function loadNext() {
_root["loadcontainer"+count] = false;
if (count<numMoviesToLoad) {
count++;
var newName = "container"+count;
_root.container.duplicateMovieClip(newName, count);
loadMovie("phase"+count+".swf", _root[newName]);
_root["load"+newName] = true;
} else {
gotoAndPlay("Scene2", 1);
}
}
loadNext();
This works absolutely perfect on a mac, but on a PC it fails - only the main movie and the first sub-movie load, then it stops and does the other movies only if you refresh the browser after each one.
WHY????????????
I realise this is a lot to take in, but any help would be awesome!
By the way, my site is
www.tobiasbusch.com
Check it out!
Thanks!
View Replies !
View Related
How To Load Sequential Swf's
I'm using Flash 8 pro, and an animator rather than actionscript jockey, so need some help with this basic task:
I have a series of separate swf files that I want to load sequentially (after each is finished playing) into a movieClip (called 'swfPlayer') in my main movie timeline. I'm able to load the first swf file into the movie clip, but I'm not sure what actionscript to use to load the next movie after the first is finished playing.
Since I need the next swf to play when the previous has finished, and the length of the movies will vary,I figured I could have a command in the last frame of each swf, telling the next swf to load into the same movieclip that the current swf is sitting in. I have access to all the original .fla's, so can add actionscript on the last frame of each.
I've tried placing a LoadMovie command in the final frame of the swf, telling it which swf to load next, but I'm not sure how to tell it to load it into the movieClip 'swfPlayer' in my main movie. I guess somehow I need to target that movieClip, but now sure of the syntax to do it.
Any help greatly appreciated.
View Replies !
View Related
GotoAndPlay Not In Sequential
I want my movie to play not in sequential such as by pressing a button at frame 1 it goes to frame 5 first then frame 3 the frame 2 then frame 6 then frame 4, it stop at frame 4. By pressing a button at frame 4 it goes back to the frame 1. By pressing the button again at frame 1 it goes to play frame 2 then frame 4 then frame 6 then frame 5 then frame 3 and stops at frame 3. By pressing a button at frame 3 it goes to frame 1 and pressing the button it goes to frame 4 then frame 2 and so on........randomly. There is only one button at frame 1. How is the action script for this scenatio ?
Thanks.
View Replies !
View Related
Sequential Fade In
Hi -
I was just put in charge of a Flash 8 project that I was taken off of about 8 months ago. Politics aside - the little AS I did know - I don't anymore. So I appreciate any patient coaching.
I'm trying to fill the stage with elements (buttons and movieclips) one by one. Instead of putting each element in a timeline with a tween, I ventured into some coding. I discovered this FadeIn code in the Flash 8 Documentation. I've found that its fine for one element but I have 10. So I made an array of all the elements (I'm only showing 5 here) and got stuck. I was thinking there must be a way to loop thru the array and apply the FadeIn function to each but I cannot get there from what I know.
TIA your expert input.
JL
Attach Code
// This got ugly real quick.
// I used this code to fade stuff in...
// for the sequence I stack these code blocks
//as the target_mc returns true it triggers the next
// function to fade in the next element.
var alpha_interval:Number = setInterval(fadeInImage, 50, txt_English);
function fadeInImage(target_mc:MovieClip):Void {
target_mc._alpha += 5;
if (target_mc._alpha >= 100) {
target_mc._visible = true;
clearInterval(alpha_interval);
FadeIn_txt_SkipInstructions();
}
}
// Brutal! - Change of tactic.
// my elements have long names so I declared vars
var E1:MovieClip = txt_English;
var E2:MovieClip = txt_SkipInstructions;
var E3:MovieClip = txt_Instructions;
var E4:Button = btn_SkipInstructions;
var E5:Button = btn_Instructions;
// Then built an array of all the vars
var EngArray:Array = [E1, E2, E3, E4, E5];
// How am I doin' so far?
// That's where I'm stuck
Edited: 04/18/2008 at 04:02:10 PM by jlucchesi
View Replies !
View Related
[FMX] Two Sequential Functions For One Mc
Hi I would like to give two actions to one movie clip. I mean when I push a button a movie clip has to execute two sequential function. The second function has to wait for the first function to complete before it starts.
To see an example click the following link:
Link
Entering the site and clicking on one of the bottom buttons gives the result where I'm looking for.
After the first time clicking on, let's say annoucements, clicking on one of the other buttons is giving the result the the white mask cover the stage and the opens again and an other mc becomes vissible.
View Replies !
View Related
Sequential LoadMovie
Hi,
I'm trying to load some swf movies using loadMovie, but I'm having the folllowing problem:
There are three movies: 1.swf, 2.swf, and, 3.swf.
=> 1.swf loads inside 2.swf
=> 2.swf loads inside 3.swf
When I test 3.swf, it plays only 1.swf (exacly where I put it in 2.swf - coordinates) but doesn't play 2.swf.
Everything looks correct, includind the containers.
All actionscript is in the frames and I'm using Flash MX.
Can anyone help, please?
Thank you in advance,
matnog.
View Replies !
View Related
Sequential Preloading (once And For All, XML)
Hello Everybody,
I want to fine-tune my working portfolio setup.
It's builds a row of thumbnails and when pressed the
portfolio item aka website or graphic is loaded in a larger version included
with information and link to the specified project.
To make it look allot smoother, i want to incorporate a sequential preload of the thumbnails
Now:Visualize a row of 20 small thumbnails on a horizontal row...
When they get loaded a want a small preloader inside and exact size of the thumb: for example filling the thumb from left to right and on loadcomplete it gets transparent..
I searched a lot of forums for sequential preloading, but no succes..
Hope someone can/wil bring up some usefull code...
here is my actionscript:
ActionScript Code:
Code:
showItemType = "website"
// DisplayInfo is used when an item is pressed
// it shows the infobox_mc, assigning the content of the selected item
function DisplayInfo(mc){
infobox_mc.title_txt.text = mc._parent.itemTitle_txt.text;
trace(mc._parent.itemTitle_txt.text);
infobox_mc.content_txt.text = mc.itemDesc_text;
infobox_mc.url_txt.text = mc.itemUrl_text;
infobox_mc.image_mc.loadMovie(mc.itemImage_text)
}
// define basic variables for setting up the menu
var item_spacing = 150; // how far menu items are spaced veritcally
var item_count = 0; // counts menu items as they are added from the XML
// CreateMenu creates a menu based on the XML object passed.
// It loops through all the items with a for loop adding clips to the menu_mc
// movieclip on the timeline, defining the appropriate text where and thumb needed
function CreateMenu(menu_xml){
// start with the first item in the XML
var items = menu_xml.firstChild.firstChild.childNodes; // menu -> menuitems -> child nodes array
for (var i=0; i<items.length; i++) {
// only continue if the type of this item is = showItemType
if (items[i].attributes.type == showItemType) {
// create variables for our elements
var itemTitle = items[i].firstChild; // same as items[i].childNodes[0]
var itemDesc = items[i].childNodes[1]; // second childNode
var itemUrl = items[i].childNodes[2]; // third childNode
var itemThumb = items[i].childNodes[3]; // fourth childNode
var itemImage = items[i].childNodes[4]; // fifth childNode
// Create a menu item movie clip in the menu_mc instance on the main timeline
// for each item element offsetting each additional further down the screen
var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
menu_mc["item"+item_count]._y = item_count * item_spacing;
menu_mc["item"+item_count]._x = i%50*120;
menu_mc["item"+item_count]._y = Math.floor(i/50)*87
// assign text using nodeValue to get the text
// from the text nodes and CDATA sections
menu_mc["item"+item_count].itemTitle_txt.text = itemTitle.firstChild.nodeValue;
menu_mc["item"+item_count].main_btn.itemDesc_text = itemDesc.firstChild.nodeValue;
menu_mc["item"+item_count].main_btn.itemUrl_text = itemUrl.firstChild.nodeValue;
menu_mc["item"+item_count].main_btn.itemThumb_text = itemThumb.firstChild.nodeValue;
menu_mc["item"+item_count].main_btn.itemImage_text = itemImage.firstChild.nodeValue;
menu_mc["item"+item_count].thumb_mc.loadMovie(itemThumb.firstChild.nodeValue);
// set the onRelease of the item button to the DisplayInfo function
menu_mc["item"+item_count].main_btn.onRelease = function(){
DisplayInfo(this);
}
item_count++;
}
}
DisplayInfo(menu_mc.item0.main_btn);
}
// manage XML
// create new XML object instance, remembering to ignore white space
var squirrel_xml = new XML();
squirrel_xml.ignoreWhite = true;
// define an onLoad to create our itemDesc menu when the XML has successfully loaded.
squirrel_xml.onLoad = function(success){
if (success) CreateMenu(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load the xml file!
squirrel_xml.load("portfolio.xml");
Thanks for your efforts..!
Best
Arn
View Replies !
View Related
[FMX] Two Sequential Functions For One Mc
Hi I would like to give two actions to one movie clip. I mean when I push a button a movie clip has to execute two sequential function. The second function has to wait for the first function to complete before it starts.
To see an example click the following link:
Link
Entering the site and clicking on one of the bottom buttons gives the result where I'm looking for.
After the first time clicking on, let's say annoucements, clicking on one of the other buttons is giving the result the the white mask cover the stage and the opens again and an other mc becomes vissible.
View Replies !
View Related
Sequential LoadMovie
Hi,
I'm trying to load some swf movies using loadMovie, but I'm having the folllowing problem:
There are three movies: 1.swf, 2.swf, and, 3.swf.
=> 1.swf loads inside 2.swf
=> 2.swf loads inside 3.swf
When I test 3.swf, it plays only 1.swf (exacly where I put it in 2.swf - coordinates) but doesn't play 2.swf.
Everything looks correct, includind the containers.
All actionscript is in the frames and I'm using Flash MX.
Can anyone help, please?
Thank you in advance,
matnog.
View Replies !
View Related
Sequential Loading
Ok, this should be pretty straight forward except I can't wrap my head around it. I am using XML and the moviecliploader class in Flash 8 to import images with a loop looking somewhat like this:
ActionScript Code:
for (var i:Number = 0; i < nTotalImages; i++){
// Attaches the MovieClip "image" from the library
var imageContainer = _root.attachMovie("image", "image"+i, i);
// Loads the image from the "photoImage"-array using the MovieClipLoader "image_mcl"
image_mcl.loadClip(photoImage[i], imageContainer.container);
}
My problem is that I want these images to load sequentially. Image number 2 can't start loading until image number 1 has finished loading. The reason for this is that the images all have different widths but they have to sit next to each other. With the moviecliploader they all start loading simultaneously and then there is no way to place the images correctly. I can get the width and height of the most recently loaded image with a listener and the onLoadInit-command I guess?
So to sum up what I want (but can't work out): An image is loaded via moviecliploader and its width is set in a variable. When it is fully loaded and placed on the stage the next image loads and is positioned to the right of the first image and so on and so forth.
Can anyone point me in the right direction here?
View Replies !
View Related
AS Sequential Functions
m in a sticky situation.
I'm scripting animation and i have broken each sequence into a function that calls the next function when finished. The problem is when I initiate the function again, by clicking another button. The previous string of functions is not stopped and i get a double animation happening at the same time.
My questions is: Is it better contain all tweening functions in a single large function? or is there a way to clear all running functions?
The logic currently looks like this.
*Click*
call TweenImgAlpha -> imgalpha complete
call TweenImcContainer, imgcontainer complete ->
call load image, loadimg complete ->
call tweenImgAlpaUp.
So using the mx.tween class i tween a mc then us onTweenComplete to call the next tween function.
View Replies !
View Related
[AS3] Sequential Loader
I am building a gallery and wanted to add in a sequential loader. This is my first stab at it and it works except for an error message that I cannot figure out.
I have a mc in my library with a class name of Thumb. Inside that mc is another mc called GalleryHolder which is where I am loading the images into.
Can someone help me out and give some feedback on how I can improve this.
Thanks
Error message:
ActionScript Code:
TypeError: Error #2007: Parameter url must be non-null.
at flash.display::Loader/flash.display:Loader::_load()
at flash.display::Loader/load()
at Untitled_fla::MainTimeline/loadImages()
at Untitled_fla::MainTimeline/completeListener()
ActionScript Code:
var imageArray:Array = ["pg-t-01.jpg", "pg-t-02.jpg", "pg-t-03.jpg", "pg-t-04.jpg", "pg-t-05.jpg", "pg-t-06.jpg"];
var n:int = imageArray.length;
var offsetX:Number = 0.0;
function loadImages():void
{
if( n )
{
var imageURL:String = imageArray.shift();
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, completeListener );
loader.load( new URLRequest( imageURL ) );
}
}
function completeListener( event:Event ):void
{
var mc:MovieClip = new Thumb();
mc.x = offsetX;
addChild( mc );
mc.GalleryHolder.addChild( event.target.content );
offsetX += mc.width;
loadImages();
}
loadImages();
View Replies !
View Related
XML Sequential Flv Problem
nevermind. i fixed it by changing the drag constraints even more.... 1px wasn't enough, it had to be 2.
using the modifications to lees tutorial from this thread:
http://www.gotoandlearn.com/forum/viewtopic.php?t=3941
i have the flv's playing sequentially which is great. but, the one problem i can't seem to fix is that when you drag the scrubber all the way to the right it cycles through the list very quickly. in an ideal world when you scrub towards the end of each flv, it would stop just short and play the last second or two then move on to the next one.
i have tried changing the values of the width of the loadbar and the scrubber, but it doesnt seem to help.
thanks in advance.
View Replies !
View Related
Sequential Background Preloader
I need to load a sequence of rather long - and heavy - movies into an existing movie, and i wonder whether it's possible to preload a movie once a preceding movie has finished loading *but is still playing*?
How can this be done? And is there any performance hit on the movie that is actually playing if this sort of background preloading is going on?
View Replies !
View Related
Easy One - Sequential Fade
Hello,
//MC 1, instance name "coutu" has this code attached:
onClipEvent (load) {
this._alpha = 0;
}
onClipEvent (enterFrame) {
_alpha += 5;
}
//MC 2 instance name "coutu2" has this code attached
onClipEvent (load) {
this._alpha = 0;
}
onClipEvent (enterFrame) {
if (coutu._alpha==100) {
this._alpha += 5;
}
}
//What I am trying to achieve is that a series of MCs that each in turn fade on when the previous one's alpha property reaches 100. I get no errors with this, MC 1 fades on, but not MC 2. To my not-very-codey head, this seems like it ought to work.
Thanks for the help,
Ben
View Replies !
View Related
Help With Sequential Preloading ( Flash 5 ).
Hello all
Been messing around with a site. what i need to do is sequentially preload 10 external .swf's into the main movie. Once each file has preloaded, the user must be able to chose it even if the other files have not fully preloaded ie. choose file 1 whilst the rest are downloading. I need to control actions via buttons which must always remain on top whilst the external files load beneath.
I have seen the http://www.rui-camilo.de/main.html. This is exactly what I need to do. The preloaders become buttons.
Anyone have any suggestions.
View Replies !
View Related
Sequential File Output
Hi,
Im outputting sequential files into .png format for use in an av presentation. The problem is that the movie clips within the movie show only the first frame of the clip. Why is this? whats the point of this? Why do the output files not display as they would in a normal swf file?
I wanted to output the movie as a quicktime movie, but the very vague information on macromedias site "suggests" that this is of a lower quality......why? Is this to do with the "flash media handler"? Does the FMH compess the files?
Any info on this matter will greatly appreciated
Thanks
View Replies !
View Related
Importing Sequential Images
i have 150 images (from five seconds of video at 30 fps) that i want to import into flash as (if this is the best way) sequential keyframes. i want to use the trace bitmap option to make them vectorized so when played in sequence they look like animations (inspired by the movie waking life!). i've attempted importing them all in the import window, but when i import any batch of files they all just show up on the stage and no sequential images option is presented. all of the files are named with numbers at the ends of their filenames. can anyone shed light? this might sound vague, so if you need me to further clarify i'm ready to. thanks for the help in advance!
alec
View Replies !
View Related
Problem Playing Sequential MCs In One FLA
Hi all!
Using FLash 5 on Mac running OS9.2 here at work.
Created a single FLA that within I have created 5 movie clips. I want these MCs to play one after the other on the timeline.
I have set up a separate layer for each movie clip in scene 1 and have dragged in each MC to a new frame one after the other. Ie. First movie clip that should play is frame one, second is positioned on frame 2 etc.
I have added a stop action in each MC frame on scene 1 thinking the MC will play (and not loop) and then go to the next frame and play the next MC in order. Sounds logical to me, but flash doesnt think so!
What happens is that it will play frame 1 and stop and not goto the next frame and play the next MC. If I add an action within a MC like "stop ();" and then "gotoandplay ("scene 1", 2);" it just loops the current MC and won't go to the next frame that holds the next MC that should play.
damn annoying!
any help would be great! do i need to add additional actions?
cheers
sab7
View Replies !
View Related
DuplicateMovieClip With Sequential Naming?
i have a mc that when clicked, its duplicated and the dupe has a start drag script and can be placed on a droptarget. what is the easiest way to set the name of the duplicated mc so that i can click on the original, drag and drop it, and do that multiple times with each clip having its own instance name?
View Replies !
View Related
Sequential Instance Name With Function...
MX2004Pro, fp7, as2
I'm working on a map, with mc's on the stage for each region, with instance names map0-map18. I'm trying to get each region to fade in sequentially with the following:
code:
i = 0;
map = "map"
function loadMap(){
clip = map+i;
clip._alpha = 0;
clip.onEnterFrame = fadeIn;
i++;
trace(clip);
trace(i);
}
function fadeIn(){
if (this._alpha < 100) {
this._alpha += 5;
trace("fadeIn");
}
}
loadMap();
Even though trace(clip); returns map0 as it should, it seems I'm unable to do anything with the 'clip' variable - _alpha has no effect and the fadeIn function doesn't run. If I set it to clip=map0 everything works, but I need to be able to have the value of 'clip' change with each run of loadMap. What am I missing?
View Replies !
View Related
Sequential Randomizing Script?
I need some help with some ActionScript.
I've created a simple quiz game with several true or false questions. The game script that I found works fine but I needed to make the questions to appear in random order. I found a "randomize" script online.
Here's the script that I'm using to randomize:
on (release) {
gotoAndPlay(frameNumber);
choices = ['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8', 'q9'];
frameNumber = choices[random(choices.length)];
}
I need help with script so that the questions appear only once... To randomly cycle through each question (labeled q1-9)
Once it goes through all the questions it should go to the "end sequence".
I'm still pretty new to Flash and ActionScripts...
Any help would be appreciated.
Thanks.
View Replies !
View Related
Sequential Loading Of Flash
Hi,
I am trying to accomplish something on my website.
First I have a page with a bunch of jpg plus 2 swf movies one at the top of the page & one at the bottom... This is what i'm trying to do, load all the jpg first.. once this is complete, load the swf at the top - once this is done playing load and play the swf movie at the bottom - then done - no looping..
Anyone have any ideas.. i can get one movie to load last after the jpgs with an onload event - but i don't know how to get the second movie to start.
Any ideas are greatly appreciated.
Can I use the Loadmovie function in flash to load the second movie into a different html area?
View Replies !
View Related
Seamless Sequential MovieClipLoader
I need to get several external SWFs holding video to either load into movie clips or levels and then sequence seamlessly. So as one movie finishes, the next loads in, no wait time. The goal is to have several clips look like one long clip.
I've been working on a solution that downloads and begins playing the first movie in the sequence while caching the others in the background. Before I go and tackle that in AS, I'm wondering:
Is it even possible to seamlessly load-swf, play-swf, unload-swf, load-next swf, play-swf, etc.? These don't need to be controlled with a play/stop button, just pulled from a directory and sequenced... The SWFs contain FLV video so I'm also wondering if I'm barking up the wrong tree and it's better to use a streaming server with some sort of dynamic XML playlist. Anyways!
Can anyone point me in the right direction??? Thank you in advance!!
View Replies !
View Related
Sequential Image Loading
Hi all,
This should be simple but its driving me mad.
I need to load a number of images at the same time, but load them in sequence, so top down: 1,2,3 etc.
Example here
I'm using a loop at the moment, but it doesn't have to be a loop. I know I need to check if the first image has loaded before loading the next. I'm stuck and would appreicate any advise or suggestions. The solution needs to be dynamic, as it will make up a larger app. with lots of images
code:
image_arr = ["images/hat0", "images/hat1", "images/hat2", "images/hat3", "images/hat4", "images/hat5"];
one_btn.onRelease = function() {
for (var i = 0; i<image_arr.length; i++) {
clip = holder_mc.createEmptyMovieClip("thumb"+i+"_mc", i);
clip.loadMovie(image_arr[i]+".jpg");
clip._y = 100*i;
}
};
View Replies !
View Related
Pulling Up Sequential Variables
Hey folks. I'm trying to build a Flash app with an SQL database. I have built a URL encoded PHP file to pass variables into Flash (http://www.slipabuck.com/janeti/getcards.php). I am pulling it up with loadVariables(). The tutorial I built the PHP from combines the variable name and the number i, so that the first AUTHOR field is returned AUTHOR1. I cannot figure out how to get Flash to find the variable AUTHOR1. AUTHOR+id returns "NaN" and "AUTHOR" + id returns "AUTHOR1". If I manually tell it AUTHOR1 it correctly pulls up the word "admin" but the whole point of database integration is to do things on the fly.
Code:
var id = 1;
this.onEnterFrame = function(){
loadVariables("http://www.slipabuck.com/janeti/getcards.php",_root);
cardID.text = id;
author.text = [AUTHOR + id];
}
That's what I've got so far. Of course, I'd love all the help I can get. I'll love people who share IM names even more, so I can easily follow up.
Brenton
http://www.theillustratedlife.com
aim: scribintoons
yim: brentonasimpson
NOTE: I am now trying to create a URL-encoded array, so if getcards.php doesn't make sense in relation to my question - that's why.
View Replies !
View Related
[MX04] Sequential Preloader
Hello,
I am new to actionscript but not new to flash.
Here's what I'm doing. I have 5 swf files that are being compiled into a sales video. I have a preloader on the first file that loads it once it is at 80%. I want the second one to be ready to go at the end of the first .swf. How can I have the 2nd .swf preload in the background while the first one is playing? After that, How do I have the 3rd load in the background while the 2nd is playing?
Any help is much appreciated!
Thanks,
Karldiff
View Replies !
View Related
[F8] Sequential Movie Loading?
Hello,
a small question, I am trying to swf's into a scroll pane, buttons that I add can do it no sweat, but what I am trying to do is load them sequentially using one button (step to the next movie button).
My player is a simple scroll pane with 5 buttons.
Is there a way to push a > button to make it load movie2.swf, and then the next push it would load movie3.swf, and so on.
yes if I am going to step forward, I would like to do it in reverse etc.
I can't use load next scene, or next frame, as I never know where the user has left the scroll pane playing.
View Replies !
View Related
Sequential Preloader With Indicator
Ok so i have 5 empty mc's on the main stage that load in 5 external swfs. They are all blank and stopped on the first frame so they are invisible until played.
What i need is preloader code that will load each swf and output the progress. ie. while it is preloading the first swf the text box at the top shows the name of the file and a progress bar then once loaded, preloads the next file. This is the preloader i currently have.
Code:
onClipEvent (load) {
if (_parent._parent.getBytesTotal() == _parent._parent.getBytesLoaded()) {
quickPlay = true;
} else {
preLoad = (_parent._parent.getBytesTotal()); //percent to preload
}
_parent.stop();
}
onClipEvent (enterFrame) {
gotoAndStop(loadedIndicatorFrame());
if (quickPlay == true) { //quickly play the anim
if (_currentframe == _totalframes) {
_parent._parent.play();
}
} else { //wait for the preload
if (_parent._parent.getBytesLoaded() >= preLoad) {
_parent._parent.play();
}
}
}
And the preloaders internal function for playing the loader animation that is 100frames long.
Code:
lastFrame = 1;
function loadedIndicatorFrame() {
var pctLoaded:Number = Math.floor(_parent._parent.getBytesLoaded() / _parent._parent.getBytesTotal() * 100);
var newFrame = int((_parent._parent.getBytesLoaded() / _parent._parent.getBytesTotal()) * 100);
if (newFrame - lastFrame > 4) { //too far
lastFrame += 4;
loadedText = pctLoaded + "%";
} else if (newFrame - lastFrame > 0) { //normal move
lastFrame++;
loadedText = pctLoaded + "%";
} else { //update the text only
loadedText = pctLoaded + "%";
}
return lastFrame;
}
I basically found this code and adapted it, I understand most of it but am having trouble adaption it for the purpose of my project.
Thanks
View Replies !
View Related
[CS3] Sequential Image Fader
The following script works in AS.1 but fails to export in AS.2:
Code:
setProperty ("/mc_" add movienum, _alpha, fade);
fade = fade - 5;
if(fade == 0)
{
fade = 100;
setProperty ("/mc_" add movienum, _alpha, fade);
movienum = movienum + 1;
gotoAndPlay (2);
}
if(movienum == 7)
{
fade = 100;
movienum = 1;
gotoAndPlay (1);
}
The problem seems to be:
Code:
setProperty ("/mc_" add movienum, _alpha, fade);
What do I need to change to make it work in AS.2
Thx for any help in advance.
View Replies !
View Related
Can A Function Contain Sequential Commands?
Hi,
I'm trying to set up a function that will carry out one thing and then do another.
I know you can do combined functions, but does that mean the functions will occur concurrently...? I need them to occur one after the other...
For clarity, this would be for use with an eventlistener.
Can anyone help?
Cheers
View Replies !
View Related
Swf Sequential File Load
Hi there,
My project consists of 26 lessons, each containing a minimum of 22 and a maximun of 30 swf files. In the root folder there is a file called home which gives the user access to "1.swf" in all the lessons. There is also a menu file whithin each lesson which goes to certain files in that lesson. My goal is to have a script which loads the swf's sequentially on the the last button of each file.
I tried the following script in file m1.swf in Lesson 1;
frame1:
file = 1;
frame2:
loadMovieNum(m1, 1);
frame3:
stop();
button:
on (release) {
file++;
loadMovieNum("m" add file add ".swf",1);
}
this works fine if i rename my files to m1.swf,m2.swf..etc
the big problem with this is, when i click on
lesson 1 button in home.swf, it takes me me to lesson1/m1.swf but then takes me to a blank screen(movie not loaded)?
Please help, new to actionscript!!
View Replies !
View Related
Sequential Preloader V2 IE 6 On PC Problem
I've seen several old posts about this problem, did anyone ever find a solution?
When using Jesse's code found here,
http://www.actionscripts.org/showMovie.php?id=355
It works great on the Mac but on a PC with IE 6 it gets hung up on the 1st swf.
I did some more testing on this issue and found that if you use the original tut code and files on the web, it works fine on Mac Safari and IE 6 on PC. I added additonal swfs, made the proper changes to the code and it still worked fine on both platforms. However, as soon as I pasted the code and movie clips into a different fla file, the hanging in IE on the PC problem occured. Even using the exact same external swfs, instance names, etc.
On the Mac, it still worked fine.
What could be causing this? It doesn't make any sense. I guess one could assume the code within the "container" movie clip isn't the problem, since when you hit refresh it sucessfully loads the next swf in line.
Any help would be appreciated.
Thanks.
View Replies !
View Related
Sequential Tween Classes
I'm trying to animate three clips sequentially (one after another). I can get the first two (Joan and Vivian) to work but the third one (Olivier) doesn't. I'm guessing that the script in red is the problem, but I'm not sure what to do?
var finish1:Object = new Tween(joan_mc, "_y", Bounce.easeOut, 331, 161, 1, true);
finish1.onMotionFinished = function() {
var finish2:Object =new Tween(vivian_mc, "_y", Bounce.easeOut, 331, 161, 1, true);
};
finish2.onMotionFinished = function() {
new Tween(olivier_mc, "_y", Bounce.easeOut, 331, 142, 1, true);
};
View Replies !
View Related
How Is Sequential Animation Normally Done By Developers?
>> I have three balls I want to roll onto the stage sequentially using onEnterFrame event. (No suggestions needed here, I may not even use onEnterFrame, I am just making a point.)
>> Then I want to perform another animation immediately following the balls, perhaps I will have another ball bounce in from the top. All in this i perfect sequence one after the other.
My Comment:
I would normally use an empty movie clip and add the ActionScript to control the animations above at lets say increment of five frames. This is my way of using a movie clip timeline to control sequential animations-- a "timeControl clip," as I usually name the movie clip.
My question:
As a Flash developer, what is the best way to accomplish this task? Is there a more sophisticated or industry standard way to do this?
Thanks.
View Replies !
View Related
LoadVars / Sequential Handlers
Hi,
I have a setup for a subscription page using Flash and ASP. What I'm trying to get to work is this :
FLASH > sendandload loadvars to HANDLER > HANDLER sends data to external service using a FORM (POST happens on the onLoad event of the page) > external service redirect to a webpage > FLASH loads the variables written on this webpage.
Can this be done ? or can flash only handle the variables written on the same page that was called with sendandload ?
B.
View Replies !
View Related
Sequential Manual Tweens
Hi, everyone! I'm brand new here... and i've got a frustrating problem. I'm still fairly new to the programming end of flash, and i've hit a sort of roadblock.
The file can be found at: http://www.frankelphotography.com/fpsite2.zip
I think i have everything set up pretty much the way that it should be, but i can't figure out how to get it to work. What i want is for when a button on the top is clicked, it will first advance to the end of the animation, and then go to the frame that holds the label of the button that was clicked on.... I hope that makes sense....
I've tried to use setInterval, but i cant' figure out how to make that work... (what i thought about doing is having it so that when a button is clicked, the setInterval allows the playhead to advance for X seconds, and then carry out the rest of the actions assigned to the button... i just couldn't figure out how to do that, or if it would even work.
Would anybody have a code that would work for what i'm asking?
Any help would really be appreciated.
Thanks in advance!
God Bless!
Chase
View Replies !
View Related
Simple Sequential Preloader?
Hello I am having great trouble with what I thought would be a simple task. I spent 14hrs yesterday scouring the Internet for an answer, but after not finding anything I am asking for help.
I am making a website with multiple swfs. I want to load three swfs one after the other into separate levels.
At first I used a for loop which worked except I could only load into one level and of course the first two swfs were overwritten.
The following code is what I am using now which seems to only work with a download speed of 15Kb/s, anything faster than that and more than one swf is downloaded at the same time, which seems to violate the code I have written, as the next movie shouldn't load until the first one has finished.
Thanks in advance for any and all help that is provided.
Frame 1
stop();
//--------------------<MCL>-----------------------\
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}
myListener.onLoadInit = function(target_mc:MovieClip) {
_level50._visible = false;
nextFrame();
}
//--------------------</MCL>-----------------------\
// trigger the MCL to load these assets:
myMCL.loadClip("preloader.swf", 50);
Frame 2
stop();
myMCL.loadClip("background.png",1);
Frame 3
stop();
myMCL.loadClip("navigation.swf",10);
Frame 4
stop();
myMCL.loadClip("home.swf",5);
View Replies !
View Related
AS Loop For Sequential SWFS
I got a loader_shell.swf with the following AS.
How do I get this thing to loop continuously?
stgMovies = "scene_1.swf,scene_2.swf,scene_3.swf,scene_4.swf,s cene_5.swf,scene_6.swf";
// Split above string to an array.
rraMovie = stgMovies.split(",");
nbrStartLevel = 6;
// ================================================== ================
// FUNCTIONS
// ================================================== ================
fncLoadLaunch = function () {
rraLoadStatus = new Array();
for (var icrIdx = 0; icrIdx<rraMovie.length; icrIdx++) {
rraLoadStatus.push(false);
}
_root.createEmptyMovieClip("mvcLoad", 0);
var nbrMovie = 0;
var blnLevelLoad = false;
var nbrLevel = 0;
var rfcLevel;
mvcLoad.onEnterFrame = function() {
if (!blnLevelLoad) {
if (nbrMovie<_root.rraMovie.length) {
blnLevelLoad = true;
nbrLevel = _root.nbrStartLevel+nbrMovie;
loadMovieNum(_root.rraMovie[nbrMovie], nbrLevel);
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
} else {
if (this["_level"+nbrLevel]) {
rfcLevel = this["_level"+nbrLevel];
rfcLevel._visible = false;
if (rfcLevel.getBytesLoaded()>10 && rfcLevel.getBytesLoaded()>=rfcLevel.getBytesTotal( )) {
_root.rraLoadStatus[nbrMovie] = true;
rfcLevel._visible = false;
blnLevelLoad = false;
if (nbrMovie<1) {
fncPlayLaunch();
}
++nbrMovie;
}
}
}
};
};
fncPlayLaunch = function () {
_root.createEmptyMovieClip("mvcPlay", 1);
var blnLevelPlay = false;
var nbrMovie = 0;
var rfcLevel;
var nbrFrameLast = 0;
mvcPlay.onEnterFrame = function() {
//
// IF not already playing a movie...
if (!blnLevelPlay) {
//
// IF the current movie increment number is less than the
// length of the array of movies...
if (nbrMovie<_root.rraMovie.length) {
//
// IF the movie to play now is fully loaded (just
// checking before launching play)...
if (_root.rraLoadStatus[nbrMovie]) {
// Assign boolean true to local play status variable.
blnLevelPlay = true;
// Create reference to current level to be played.
rfcLevel = this["_level"+(_root.nbrStartLevel+nbrMovie)];
// Make current level visible.
rfcLevel._visible = true;
// Launch play of current level timeline.
rfcLevel.play();
// Assign zero value to local variable tracking
// last frame played.
nbrFrameLast = 0;
}
//
// ELSE we've played all the movies; perform cleanup.
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
} else {
if (rfcLevel._currentframe>=rfcLevel._totalframes || rfcLevel._currentframe == nbrFrameLast) {
blnLevelPlay = false;
rfcLevel._visible = false;
rfcLevel.gotoAndStop(1);
++nbrMovie;
} else {
nbrFrameLast = rfcLevel._currentframe;
}
}
};
};
// ================================================== ================
// Launch loading.
fncLoadLaunch();
View Replies !
View Related
|