Part 2 - Movie Loads Too Fast And Won't Play The Mc
Here is what I have in the "navigation" movie button on(release){ _level0.gotoAndPlay("label"); } on(release){ whereToGo="label"; }
Here is what I have in the "b" movie gotoAndStop(_level0.whereToGo);
- the movie is called from the base so there is The "navigation" tells it where to go on the base movie. The frame that it goes to already has a load movie going on. So it loads that movie "b" into the clip.
I have it working great except for the movie loads to fast and does not have time to play the movie clips in that movie.
Usually the page turns up blank.
Any ideas?
FlashKit > Flash Help > Flash MX
Posted on: 03-21-2003, 10:46 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Movie Loads Separately But Not As Part Of Whole...
I am trying to load jpeg images using loadMovie. I have a movie that has thumbnail images that load larger jpeg images when the user clicks on a thumbail. This movie is loaded from an action in the root timeline. When launch the swf file for that movie as a separate movie it loads the images fine.
Here is the code:
on (release) {
width = 251;
unloadMovie(image_mc);
image_mc._x = (460 - width)/2 + 290;
loadMovie("../images/weddings/1.jpg", image_mc);
}
This is attached to the thumbnails. It unloads the previous jpeg that was there and then loads the new jpeg. The strangest thing is that everything used to work just fine.
LoadMovie Only Loads Part Of Movie
I am trying to load a 600K swf into a parent swf file. When I test the parent movie, it only loads and plays part of the 600K file. Is this because the file is too big and all of it hasn't loaded yet; even if I wait it still only plays the same clip from the 600K file. The 600K file is made up of 7 movie clips that play in succession (with one activating the next one and so on). The parent movie only seems to play the first of these clips. Is there something that I need to add to the code to get it to recognize the other movie cilps in the 600K file. The 600K file plays perfectly when opened alone in the flash player.
Thanks for any advice. I've looked through numerous books and online help and can't find anything describing this problem.
[CS3] : Fast-forward Play For Movie Clip
Hi,
I have embedded a short movie clip (called 'clip') into flash (not as an flv),
and added the following code to make it run in fast-forward mode. It works fine in the beggining, but crashes after a minute or so ! Any idea why ?
package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.Event;
public class SmartFastForward extends Sprite {
public function SmartFastForward() {
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event) {
if (clip.currentFrame < clip.totalFrames-1)
clip.gotoAndStop (clip.currentFrame + 2);
else
clip.gotoAndStop(1);
}
}
}
Thanks !
Play A Movie Clip Slow Then Fast
Hi
I have created an movie clip that has 20 frames running at 30FPS its a motor running with a fan on the front.
Is there any way that when I start the motor (movie clip) via a button that I can get the movie clip to start slowly and then go fast (and stay fast).
Regards, Dave
How Do I Get A Button To Play A Movie Then Go To Different Part Of The Timeline And P
I'm building a Flash site that uses loader components. The timeline is divided into 5 sections each with its own loader component with its own Instance name. I've had no problem creating buttons on the main timeline that 'go to and stop' at a particular section and allow a movie to load and play. However, sometimes I want a single button to 'go to and stop' at one section, play the movie then 'go to and stop' at another section and play that movie. Surely there must be a simple piece of action script to give the button the function I need?
I have Flash MX 2004.
Below is what I'm currently doing:
Each loader component has its own Instance name and is set to:
autoload: true, content path: (the appropriate .swf movie), scaleContent: False
The timeline is divided into ten frame sections. Each had a 'stop' command in 'Actions'. Each has a Frame Label title. To create the button command, I select the button, then go to 'Behaviour' - 'Movie Clip' - 'Go to and stop at frame or label'. Where it says: 'Choose the movie clip ...' I leave it on 'this' and I also leave 'Relative' selected. Where it says: 'Enter the frame ...' I type in the Frame label title.
Any ideas?
Cheers
Nick
Getting A Button To Play Part Of A Movie Clip
Hello all,
I would like part of a movie clip to play when a button in the main movie is released. I put a stop action on the first frame of the movie clip and on the frame where I want the movie clip to stop. I have following script on the button -
}
on (release) {tellTarget ("/clip") {
play ();
}
}
This script results in the following error -
Target not found: Target="/clip" Base="_level0"
Can anyone help with what I am missing?
Thanks,
CG
How Do I Get A Button To Play A Movie Then Go To Different Part Of The Timeline And P
I'm building a Flash site that uses loader components. The timeline is divided into 5 sections each with its own loader component with its own Instance name. I've had no problem creating buttons on the main timeline that 'go to and stop' at a particular section and allow a movie to load and play. However, sometimes I want a single button to 'go to and stop' at one section, play the movie then 'go to and stop' at another section and play that movie. Surely there must be a simple piece of action script to give the button the function I need?
I have Flash MX 2004.
Below is what I'm currently doing:
Each loader component has its own Instance name and is set to:
autoload: true, content path: (the appropriate .swf movie), scaleContent: False
The timeline is divided into ten frame sections. Each had a 'stop' command in 'Actions'. Each has a Frame Label title. To create the button command, I select the button, then go to 'Behaviour' - 'Movie Clip' - 'Go to and stop at frame or label'. Where it says: 'Choose the movie clip ...' I leave it on 'this' and I also leave 'Relative' selected. Where it says: 'Enter the frame ...' I type in the Frame label title.
Any ideas?
Cheers
Nick
Getting A Button To Play Part Of A Movie Clip
Hello all,
I would like part of a movie clip to play when a button in the main movie is released. I put a stop action on the first frame of the movie clip and on the frame where I want the movie clip to stop. I have following script on the button -
}
on (release) {tellTarget ("/clip") {
play ();
}
}
This script results in the following error -
Target not found: Target="/clip" Base="_level0"
Can anyone help with what I am missing?
Thanks,
CG
Play 1st Part, Preload 2nd Part, Play 2nd Part: Possible?
I've recently started with Flash development and I was wondering if the following was possible using only one Flash file?
- The first part is shown and the user can click a button here to continue.
- When he clicks the button, a preloader part is shown and the rest of the file is loaded.
- When it's done, the rest is shown.
I already have the parts seperated in movieclips and unchecked the "export in first frame" option on the movieclips for the second part, but that doesn't help.
If this isn't possible, how should I go about it then? Should I use a second .swf which I load with a loadMovie statement?
Buttons That Play A Movie In Reverse And Loads A Movie
Let's say i have a movie that plays, scene and the buttons are placed on the movie and and the movie stops, okay now my problem is that, I would like to know if its possible, and how to do this:
Once my movie and buttons are loaded on the scene, i want to know if there is a way, that i can make it so that, once i click on one of my buttons, the movie goes to a certain frame on the movie so it looks like its playing backward to a blank screen, and after its to a blank screen i want it to load the appropriate movie for the button i clicked.....
I tried to this a while ago, and it did not work, since i have 12 buttons that are linked to open and play 12 different movies...
any kind of help would be greatly appreciated......
thanks
Movie Does Not Auto Play When Web Page Loads
Through actionscript.org members and various other internet sites, I've managed to come up with code that reads picture links and hyperlinks from a text file. Then with the help of a MovieClipLoader loads them sequentially, fading them in and out, hence creating a dynamic slideshow of latest news with pictures for users to click and navigate selves to. However, upon having the webpage load for the first time, the movie will not autoplay. It will hang up on the second frame (code of which I include below). If I refresh, or select play, it will start playing immediately. Can anyone help me with as to why this is happening and how can I solve it?
http://www.ravenguild.net/havenslide.html
is a webpage with just the movie on it, should anyone wish to see the event in action.
Code:
var imgLoader = new MovieClipLoader();
this.createEmptyMovieClip("image_mc",0);
if((firstLoad == false) & (secondLoad == false) & (thirdLoad == false))
{
_root.myBar._visible = false;
}
else
{
myBar.mode = "manual";
myBar.setProgress(0, 100);
myBar.mode = "polled";
myBar.source = image_mc;
_root.myBar._visible = true;
}
image_mc._x = 20;
image_mc._y = 20;
image_mc._alpha = 0;
if((firstPic == false) & (secondPic == false))
{
imgLoader.loadClip(thirdpicture,image_mc);
}
else if((thirdPic == false) & (firstPic == false))
{
imgLoader.loadClip(secondpicture,image_mc);
}
else
{
imgLoader.loadClip(firstpicture,image_mc);
}
stop();
imgLoader.onLoadComplete = function(targetMC)
{
_root.myBar._visible=false;
onEnterFrame = function()
{
targetMC._alpha +=3;
if(targetMC._alpha >=100)
{
delete onEnterFrame;
gotoAndPlay(3);
}
}
}
When embedded to a webpage, my flash movie will get hanged up on this code's frame (frame 2) with the progress bar stuck at 0%. Not unless I either refresh the page, or press a button...It's as if it hangs up on the stop(); there. If I refresh the page then the progressBar loads normally and so does the movie go on playing.
Many thanks in advance.
Forcing A Preloader To Play The Intro Before It Loads The Main Movie.
Hi,
I am using a script I found at http://www.sonify.org/home/feature/r...ges/page4.html for preloading my movie, which contains a lot of sound objects located at http://www.speakerson.net/project/start.html. The main movie is loaded into a movie clip holder called "sonicMapHolder".
It works like a treat ...
However I would like to apply one modification, that is to play the whole intro every time before the main movie loads. The intro is located in a movie clip called "textintro".
Can I do it easily?...
Thanks in advance!
Gayeta
Forcing A Preloader To Play The Intro Before It Loads The Main Movie.
Hi,
I am using a script I found at http://www.sonify.org/home/feature/r...ges/page4.html for preloading my movie, which contains a lot of sound objects located at http://www.speakerson.net/project/start.html. The main movie is loaded into a movie clip holder called "sonicMapHolder".
It works like a treat ...
However I would like to apply one modification, that is to play the whole intro every time before the main movie loads. The intro is located in a movie clip called "textintro".
Can I do it easily?
Thanks in advance!
Gayeta
Forcing A Preloader To Play The Intro Before It Loads The Main Movie.
Hi,
I am using a script I found at http://www.sonify.org/home/feature/r...ges/page4.html for preloading my movie, which contains a lot of sound objects located at http://www.speakerson.net/project/start.html. The main movie is loaded into a movie clip holder called "sonicMapHolder".
It works like a treat ...
However I would like to apply one modification, that is to play the whole intro every time before the main movie loads. The intro is located in a movie clip called "textintro".
Can I do it easily?...
Thanks in advance!
Gayeta
Does Swf Size Determine How Fast It Loads
Does SWF exported size determine how fast a movie will load? I have a swf that is 298KB that takes about 1 minute to load on a 49K modem, but a 213KB swf loads in about 15 seconds. I am trying to understand how to optimize the best I can.
Swf Loads Too Fast Too See Quick Intro
Site has a small preloader swf that loads a much larger swf. Preloader has a very short graphical intro w/progress bar, that slower connections will see. Faster connections load the large swf quickly enough to bypass the intro graphic. What changes to this preloader code will preserve the quick intro view - even if the main swf loads quickly?
Thanks!
tay imagery
ActionScript Code:
var myRequest:URLRequest = new URLRequest("taySite.swf");
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showContent);
myLoader.contentLoaderInfo.addEventListener(Event.INIT ,initHandler);
var myPreloader:Preloader = new Preloader();
function showPreloader(event:Event):void {
addChild(myPreloader);
myPreloader.x = stage.stageWidth/2;
myPreloader.y = 650;
}
function showProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = Math.round(percentLoaded * 100) + "%";
myPreloader.bar_mc.width = 198 * percentLoaded;
}
function initHandler(e:Event) {
MovieClip(LoaderInfo(e.target).content).stop();
}
function showContent(event:Event):void {
removeChild(myPreloader);
logoShow.gotoAndStop(411);
addChild(myLoader);
MovieClip(LoaderInfo(event.target).content).play();
}
[CS3] When Image Loads In, Part Of It Is Gray Why?
hey guys,
right - take a look at http://copperimage.com - when i view it, sometimes one or two of the pictures look like they aren't fully loaded, because the rest of the image (mostly like half of it is missing), is filled in by gray (or grey?).. does anybody know why this happens?
christian
Preload Animation Slowdown - Loads Too Fast HELP
Hey everyone - I just searched through 16 pages here of preload questions. I'm FINE with preloading - it's great!
My odd request is:
I have an animation of a bar filling up from 1% to 100% based on the bytes loaded of an externally loading swf into a movie clip on the main movie
This looks GREAT on slow connection speeds - however on fast connections or when the swf is cached you don't see the progress bar animate at ALL! It just shoots straight to 100%
HOW do I SLOW THIS DOWN???
I want it to always animate - but be slightly faster on faster connections however still retain a true 'preloader' status by actually preloading the swf files.
So far - NO ONE I've asked - e-mailed - or looked at on these boards can answer this.
Can YOU???
I'd LOVE YA forever!!
Thanks!
// jayse
PS - here's and example of it tweened - I'd like it to load like this on fast connections - and then be a real preloader on slower connections:
http://www.cytekstudios.com/clients/saloneraji/
Trigger A Button In Work Part Of The Movie From Another Part Of The Movie
i did know how to do this but since forgot
i have my bav bar mc with all the button to load relevent sections
THe code for the buttons are on a keyframe
ActionScript Code:
b1.onRelease = function() {
_root.win1._alpha = 0;
_root.win1.loadMovie("blog.swf");
_root.win1._x = 0;
_root.win1._y = 25;
ov1.gotoAndStop(15);
b1.enabled = false;
//
};
In the past i was abe to trigger this from elsewhere in my movie but i have since forgot how to do it. i did scan the help files but couldnt find anything of any relevenace.
Thanks for any help.
Paul
How To Make Flashtrack Play Auto Play When Swf Loads.
I need to know how to make Flash Trak and it's player play auto when I test a movie or run swf file.
I don't want to click on Play Icon to play it. Just have to have it auto play for my presentation.
Thanks,
dumshi
External Movie Loads, But The Dynamic Text That Loads With It Won't Render HTML?
I have a set of SWFs that load when a button is pressed on the parent SWF file...they all load into an empty placeholder, and each contains it own dynamic text field. the problem i'm having is, the text loads, but the HTML won't render, so i get plain text and html tags
the script in my external SWF files is as follow.
var lv = new LoadVars;
lv._parent = this;
lv.onLoad=function(success){
if(success)this._parent.home.text = this.guide;
}
lv.load("guide.txt");
everything is filled out correctly in the Property menu, someone PLEASE help
How Do I Play A Part Of A Movie Clip From Another Movie Clip?
Hello
On the main timeline (_root), I have a movie clip with a button inside it. I want that button to link to and play from a particular frame in another movie clip which is located on a different frame in the main timeline (_root). How do I do that?
peace,
cc
Load Movie By Number 1.swf Loads 2.swf Loads 3.swf
hey everybody,
i have a main movie in which i load an externel "1.swf". i've got plenty of swf's to load (2.swf, 3.swf, 4.swf and so on) how can i make a link in 1.swf which automatically loads 2.swf.
i don't want to specify load 2.swf - i want it to load mynumber+1.swf (i think you get the idea). so that i don't have to make every link. i want 1 code for all.
thanks for helping me out on this one
Remote MP3's Play Too Fast
I'm trying to make a flash player that plays remote MP3's, and all my MP3's play super-fast.
They play great in every other player I've ever tried, software and hardware. I understand the flash player only plays a certain range of sample rates, but since re-encoding the world's MP3's is not an option, I was wondering if anyone has found a way around this problem?
If I do have to re-encode all my podcast's episodes, is there a way to use the LAME encoder to do this? I can't seem to figure it out on windows... (linux looks like I could use the command-line, but then again, I can't write the flash in linux, so I'm having to bounce back and forth)
Any ideas of what I should do?
Play A Part Of The Timeline Backwards
Hello all!
Does anybody know how you can play a part of your timeline backwards?
In most cases you say: gotoAndPlay("someframe"); and it plays it 'till it finds a stop();
Now I want it to do the same but backwards, that it goes to that "someframe", but that it plays to the beginnng in stead of to the end...
Anyone an idea?
Thx a lot in advance!
FLV Loads But Won't Play
hello,
I am creating a video player that loads some info from an xml file, places it in a little scrolling menu thingy. When you click on each of the menu items, it is to play the flv referenced in the xml to the side. The xml appears to be coming in fine and everything looks right. The problem lies in that
a) The only video loading is the first one.
b) When the video loads, it pauses on the first frame. Everything I try has no affect on the displayed video.
The script is as follows (I apologize for the clumsyness of my code. I only have a year at this crap so far):
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.html = true;
my_xml.onLoad = function(success) {
if (success) {
var videos = this.firstChild.childNodes;
var number_vids:Number = videos.length;
for (var i = 0; i<number_vids; i++) {
var currVid = videos[i];
var currVidElements = currVid.childNodes;
var currVidTitle = currVid.firstChild;
var currVidImageFile = currVidTitle.nextSibling;
var currVidImageFile_str = currVidImageFile.firstChild.toString();
var currVidHead = currVidImageFile.nextSibling;
var currVidVidFile = currVidHead.nextSibling;
var currVidVidFile_str = currVidVidFile.firstChild.toString();
var currVidLength = currVidVidFile.nextSibling;
var currVidLink = currVidLength.nextSibling;
var currVidLink_str = currVidLink.firstChild.toString();
var the_video = _root.vid_menu.vidClips.attachMovie("vidclip_maste r", "vidclip_"+i, 10+i, {_x:0, _y:90*i});
the_video.onRelease = function() {
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(1);
thevideo.attachVideo(stream_ns);
stream_ns.play(currVidVidFile_str);
stream_ns.onStatus = function(infoObject:Object) {
trace("infoObject: "+infoObject.code);
if (infoObject.code == "NetStream.Play.Start") {
}
if (infoObject.code == "NetStream.Play.Stop") {
}
};
trace(currVidVidFile_str+" VIDEO:"+i);
};
B_lank.onRelease = function() {
getURL(currVidLink_str, "_blank");
};
the_video.highlighter.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this._alpha = 100;
} else {
this._alpha = 0;
}
};
the_video.image_holder.loadMovie(currVidImageFile_ str);
the_video.Clip_number.htmlText = currVidTitle.firstChild;
the_video.Title.htmlText = currVidHead.firstChild;
thevideo.Duration.html = true;
the_video.Duration.htmlText = currVidLength.firstChild.nodeValue;
}
}
};
_root.vid_menu.scroller.up_but.onRelease = function() {
clearInterval(moving_dn);
};
_root.vid_menu.scroller.dn_but.onRelease = function() {
clearInterval(moving_up);
};
_root.vid_menu.scroller.up_but.onDragOut = function() {
clearInterval(moving_dn);
};
_root.vid_menu.scroller.dn_but.onDragOut = function() {
clearInterval(moving_up);
};
_root.vid_menu.scroller.up_but.onReleaseOutside = function() {
clearInterval(moving_dn);
};
_root.vid_menu.scroller.dn_but.onReleaseOutside = function() {
clearInterval(moving_up);
};
_root.vid_menu.scroller.up_but.onPress = function() {
clearInterval(moving_up);
moving_dn = setInterval(move_em_dn, 10);
};
_root.vid_menu.scroller.dn_but.onPress = function() {
clearInterval(moving_dn);
moving_up = setInterval(move_em_up, 10);
};
function move_em_up() {
if (vid_menu.vidClips._y>=(-1*(vid_menu.vidClips._height-150))) {
_root.vid_menu.vidClips._y -= 1;
}
}
function move_em_dn() {
if (vid_menu.vidClips._y<=10) {
_root.vid_menu.vidClips._y += 1;
}
}
my_xml.load("videos_r2.xml");
Thank you for any help anyone can provide!
_warren
Make End Of Video Play Another Part Of Flash?
I am trying to simply make frame 2 start only after the video finishes completely, which is on frame 1.
I made a cue point on the flv called 'ending' at the very end of the short video. In the .fla Actionscript I tell it to go to frame 2 when it reaches the 'ending' cue point.
Please help!
Here are the files
http://www.worldwideathlete.com/flashvideofiles.zip
Play Backwards Script Good But On Fast Mouseover :O(
hi there
i have a clip+invisable button, on which i have placed a script, so when there is a mouseover, the clip starts playing, on a mouse out, the clips start playing backwards.
on (release/mouseout/xx) {
_root.onEnterFrame = function() {
_root.prevFrame();
if (_root._currentframe == 1) {
delete _root.onEnterFrame;
}
};
}
this all works well, as long as you do it very very slowly. (the clip that is being played and reversed is about 100 frames.... (build up of a flower, shapes not motion tween)
but if you do a fast mouse over, the clip stops, goes back to frame one, without playing again...
(first and last frames have a stop)
does anybody have a good solution....?
regards
[F8] Sounds Play Too Fast? (not A Boring Streaming Question)
Hi, I'm sorry my first post has to be a query, but you can consider it a bug a report if you prefer. I cannot guarantee that this is not a mistake on my behalf, but I think after two days I've ruled out the possibility of a stupid mistake :-)
I've run into the bizarre problem that onSoundComplete triggers before the sound is meant to have finished. Lemme explain the sample file, and why this behaviour is strange.
In a blank flash file (Flash 8), I add a single sound, and the following code:
Code:
var s=new Sound();
s.attachSound("one.wav");
s.onSoundComplete=function(){
trace(getTimer());
}
g=getTimer();
s.start();
trace(g);
trace(s.duration);
trace(g+s.duration);
My traced output is:
Quote:
124
895
1019
878
I.e. onSoundComplete is running about 100ms earlier than you would think, given by the start time and sound duration. I could understand that onSoundComplete might finish early in order to help timing issues, but as far as I can tell from playing other sounds simultaneously, the sound is actually finishing at 1383ms, not 1478.
I have checked s.duration in Audacity, and it matches correctly to the ms. The import settings for the sound are the default, I'm importing it from a mono 22kHz WAV.
Worse, I get different results, but still strange ones, when using s.start(0) instead of s.start().
I cannot get the upload button to work (in ie or firefox), so if you want the fla, kindly download it from my website at http://adam.newgas.net/temp/bizzarre2.fla
Do other people get the same issue, and any thoughts on why it's occuring?
PS:
In case you are wondering, I am attempting to make a component which, similar to http://sonify.org/tutorials/flash_audio/advanced/midisynth/ , attempts to use a certain amount of silence at the beginning of the track and seeking in order to get accurate placement of sounds, in my case seamless looping. My component works great, but for some reason you can still here a seam between the first and second sounds played (but not the others, for some reason). I eventually tracked the problem down to this, as I was using setInterval(myFunc,sound.duration) instead of relying on onSoundComplete.
PPS: Yes, that is my dopey voice saying "one".
LoadMovie Loads But Will Not Play
Hi,
I am new to Flash and have a problem using loadMovie to load a swf.
I created an empty movie clip and placed an instance of it called contentholder.
The following code loads the menu.swf in the correct place, but the menu will not work.
loadMovie("menu.swf","_root.contentholder");
Both the swf file and the movie I am loading it to are in the same folder.
When I tried loadMovie("menu.swf",1);
the menu loaded and worked fine, but it loaded in the upper right corner of the screen, and I cannot seem to control where it is located.
Any help someone can give me with this problem would be greatly appreciated.
Need To Have One Mp3 Play On Its Own When Webpage Loads
Hello,
I just need a very simple .mc or something to get a .mp3 file to play when the visitor visits this one page on the website.
It doesn't really need to have any buttons at all---but I want it to be quick loading as the mp3 is about 1.3 mb
the mp3 is already loaded to the hosting server--is there any way to call it to play or something?
I just need something extremely simple.
Thanks
Play Frame After Swf Loads...not Before
This is probably fairly simple. I am trying to load an external swf into the maintimeline on a specifac frame. My problem is that it is executing the gotoAndPlay code before the swf is full loaded so it ends up just starting on frame 1. How do I write code to say
"load the swf and when finished loading gotoAndPlay(certainframe);
thanks!
Help External .swf Loads But Does Not Play
First of all, let me say, please don't kill me for cross-posting!! I noticed at the end of the tutorial, the guy said that if you have any trouble that those in the Flash MX 04 forum would be more than happy to help. So please don't kill me for cross-posting!
I followed this tutorial on here for making a reusable actionscript preloader (link: http://www.kirupa.com/developer/act...ecliploader.htm). Works fine when loading a .jpg, but when attempting to load a .swf it doesn't work. It says it's loaded, but the .swf doesn't play!!! In fact, the .swf doesn't even show up!!! Is there some code I need to add to make a .swf play when loaded? Here's the code which went into a frame in the actions layer. It's the exact same code as in the source example for the tutorial, I just chopped out the buttons part of the code, and the fade in part and replaced the jpg URL, with my .swf URL. Sorry if it's really simple, I'm not an expert at AS.
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("http://www.peacefulvalleyfarm.com/Flash/Sadie.swf", "container");
Button Loads MC But Does Not Play It?
Ok, so i have been learning little by little some AS through Kirupa, but i still need the help. So here is my issue i have this code below that allows me to switch between images using a mc button, but when i press, the mc loads but does not play the fade in? Can someone explain what is missing in this code that skip the play?
----
stop();
MC1._visible = true;
MC2._visible = false;
Btn2.onPress = function(){ //brings up the second movieclip
MC1._visible = false;
MC2._visible = true;
}
Btn1.onPress = function(){ //brings up the first movieclip
MC2._visible = false;
MC1._visible = true;
}
----
How Can I Make Mp3 Play As Soon As The Page Loads?
hello,
i have set up an mp3 player which loads songs from a playlist.xml however when the page loads it seems to be trying to load the whole song before playing, (or perhaps even all four - it hasnt played a sound yet ).
what can i do so that the player just plays the music as it loads?
thankyou.
ps i've attached the .fla file that the player is based on.
pps the songs are about 3mb each - is this too big?
Sound Loads But Doesn't Play
Hi,
I'm building a basic mp3 player which loads an external sound and plays it, with a couple of custom built components such as play/pause button, stop button, volume seeker and playhead seeker.
In the Flash CS3 IDE, the whole thing works perfectly.
When uploaded to a web page, the SWF file gets to the frame which loads and plays the sound, and it successfully loads the sound, but doesn't play it. Here's the code (from the Actions timeline layer) which I think is relevant:
Code:
var music:Sound = new Sound (new URLRequest('audio/bathroomrondo.mp3'));
var sc:SoundChannel;
var isPlaying:Boolean = false;
music.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
music.addEventListener(Event.COMPLETE, onLoadComplete);
music.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
music.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
function onLoadProgress(event:ProgressEvent):void
{
var loadedPct:uint = Math.round(100 * (event.bytesLoaded / event.bytesTotal));
trace("The sound is " + loadedPct + "% loaded.");
}
function onLoadComplete(event:Event):void
{
sc = music.play();
isPlaying = true;
var loadedText:TextField = new TextField();
loadedText.text = "Sound loaded successfully.";
this.addChild(loadedText);
loadedText.x = 150;
loadedText.y = 20;
loadedText.textColor = 0xFFFFFF;
loadedText.width = 200;
}
function onPlaybackComplete(event:Event):void
{
seeker_mc.slider2_mc.removeEventListener(Event.ENTER_FRAME, enterFrame);
gotoAndPlay(16);
}
function onIOError(event:IOErrorEvent):void
{
trace("Error loading file.");
}
I believe it's loading correctly because the temporary text field is displaying on the onLoadComplete event, but the sc = music.play() seems to do nothing.
Any ideas why this is happening?
Thanks,
Chris
Sound Loads But Refuses To Play
simple:
var my_sound:Sound = new Sound();
my_sound.loadSound("music/" + mix, true);
of course, it's alot more complicated, but this won't even work. It loads the file, I know because I can see the duration, but refuses to play it. I've tried start(), (this), and onLoad() to get it started up, but none work. Th silly thing is that it works perfectly on my laptop, but not on my desktop or more importantly, my web page. I thought there might be some security issues involved (a grey area for me) but then why would the file load at all? As you can see, the songs are just in a subfolder, so I can't see why there would be a problem.
I even created a test.fla that was just a copy-paste job from the Sound class documentation, with no bells or whistles, and even that didn't work- again it would load all right, but not play. I would have just assumed some setting was amuk on my desktop, but it also doesnt work on my site. So I'm stuck sucking a gas pipe... anyone have some suggestions??
Play Sound After External Swf Loads
I have a button that calls one of 220 external swfs (based on variables)
How do I play a sound from the root movie once the swf has completed loading?
ActionScript Code:
on (release) {
loadMovie("219.swf");
}
//once movie has loaded, play sound which is already on root stage (in a movieclip)
Thanks
Txt Loads "too Fast"
i'm loading several txt files into a dynamic text box (one at a time). i made a small rectangle above the text box which fades it's alpha value so it looks like the text box is fading in. hope you understand this.
the problem is the txt is shown for like 0.10 seconds before the above fadin animation starts. how can i bypass this problem? i have attached the files so you see the problem yourself. only the first 2 website txt work. keep the files in their folders to make it work
hope somebody can help...if you need further info, let me know
Play Small Animation While External Swf Loads
I have a big animation that loads externally:
instance.loadMovie("file.swf");
While this external file is loading, I want a smaller animation to play that I've created.
When the external file has finished loading, I want the smaller animation to stop.
How can I do this?
External Loaded Swf Loads, But Doesn't Play
I have used loadMovie to load my external swf file into an empty mc and that works fine instead the main swf.
ActionScript Code:
loadMovie("final_k.swf", "empty");
But when I interact with it, it doesn't "play". Is there something I'm missing to get my externally loaded movie to "play"?
Thanks for any help.
Play Animation On Exit Before Next Page Loads
Hello, I have posted this question a few times on other boards and I can still not get this to work.
Here is what I want.
It is pretty simple to make a flash site that when you click a button graphics fly around all this fancy stuff happens etc...BUT When you click another button the page you currently are on just dissapears and then the next page loads and does all its fancy stuff again.
So what I am wondering is what is a simple way of having for example this:
HOME page fades in
User clicks ANY BUTTON
HOME page fades out
then whatever page Clicked FADES in
**Obviously this would be the same for any page you are viewing. And I am using fade in/out as a simple example.
This would be very easy to do if I knew the viewer would press the buttons in a certain order but like that will happen. Also I have no problem doing this with a few pages by just putting everything linear on the timeline. But things start to get crazy when I have alot of pages.
Is there an action that I could apply to my buttons that perform the task of "When user clicks X button, Play exit animation of the page you are currently on before loading page that the user clicked"??
Any help would be greatly appreciated I have been trying to find an easy way to do this for quite some time....
PS sorry about the long post...
see ya
Unable To Play Flv From Xml Though The Xml Loads Perfectly Fine
I am unable to play flv from xml though the xml loads perfectly fine. When flv path is hardcoded the video plays fine but when from a node it seems to make the video disappear and it dosent play...
Please can anyone help me with this...
here is the code.
I am having the same issue i got the xml loaded and even the url into the video source but it dosen't seems to play the video when reading from xml...
please let me know what i can do to correct this...
thanks in advance..
here is the code.
var urlname:String;
function loadXml() {
urlname = content.firstChild.childNodes[0].firstChild;
//trace(urlname);
videoload();
}
content = new XML();
content.ignoreWhite = true;
content.load("one.xml");
content.onLoad = loadXml;
function videoload() {
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(4);
my_video.attachVideo(stream_ns);
//playing the video.
//stream_ns.play("video/intel.flv");/*displays a black bg but video not played*/
stream_ns.play(urlname);
//trace(stream_ns);
trace(urlname);
}
//
stop();
this is the xml
<content>
<cvname>video/vid.flv</cvname>
<content>
Thanks In advance.
Play Two External Swfs; First One Plays While 2nd Loads
lets say I load an external swf(external1.swf) into a movie into a movie clip called "the_one". How does the main timeline know when external.swf has finished playing. Basically I need the main timeline to play the first swf (external1.swf) while the second swf is loading and then play the second when the first is finished even if the second is still loading.
CODE_root.createEmptyMovieClip("the_one",1);
_root.the_one.loadMovie("external1.swf");
_root.createEmptyMovieClip("the_two",2);
_root.the_two.loadMovie("external2.swf");
Button Rollover Starts To Play When Page Loads
Button rollover starts to play as soon as the page loads then when you rollover it acts as it supposed to.
Does anyone know how I can fix this probably simple thing.....I'm very new to flash as you've probably guessed!
Thanks
Linsey
[MX04] How Much Of A Streamed MP3 File Loads Before Play Actually Starts?
I built a streaming MP3 player (XML driven) that also has an equalizer (well.. a random animation of bar mc's the simulate an EQ anyway...) The EQ even scales up/down as you adjust the volume.
Ok.. here's my issue : When you press either the play or pause buttons, it will hide or show the EQ mc. BUT because the tracks are streaming, Flash had to load a certain amount of the file before it actually starts playing in the browser. So it looks funny when the EQ starts cranking away but the track hasn't started playing yet.
So now my question :
How can i make the EQ wait to display until the track is ACTUALLY playing? I can't really just put a generic delay on it, because of obvious reasons (connection speed, file size etc)
Is there a predefined number of bytes/percentage of a file that has to load before the file actually starts playing in Flash?? I've looked all over and haven't found any info anywhere.
If you need to see my code or need more info, let me know. I'll be happy to post.
Thanks for any help/ideas!!
|