Controlling Order Of Functions/ Playback
whats up people,
i've been going at this problem for pretty much the whole day and i can't seem to get it. here's the deal. i want my bars to close - load content - then open up again once done loading content. unfortunately my actionscript skills aren't up to the level where i can write code unconciously so its been taking me quite some time to figure all this out. here's the code as it stands now.
function initNews() { _global.active = this; News.newsHL_mc.flicker(5);
eMenu.onEnterFrame = null;
//show newsNav newsNav_mc._visible = true;
// //:::::here's where im having problems::::::// // //reverses bars pos to hide content openBars(news1,95,-95) openBars(news2,95,-95)
loadNews(0); while(this.active){ if(news1_mc.mBar_mc.mc_bBar._y == -95 ){ //load Content holder1.loadMovie("images/photo1.jpg");
//openBars openBars(news1,-95,95); openBars(news2,-95,95); } }
}
all i need is a point in the right direction. please dont feel compelled to give me the whole answer(though i wouldn't mind). any help as always is greatly appreciated. thanks for your time.
++erase++
Ultrashock Forums > Flash > ActionScript
Posted on: 2003-03-21
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Functions In A Certain Order
Problem:
I want to be able to run functions in a certain order from an array. The code below is a non-fat version of what I want to accomplish. The problem appears when the function(scream_name) runs. Flash makes the passed variables into one variabel; sname = "John", "Doe" and lname = undefined.
Anyone?
Code:
function run_func(func,vars){
func_ready = func(vars);
}
function scream_name(sname,lname){
trace(sname add " " add lname);
return true;
}
functions_ = new Array(
[ scream_name, ["John","Doe"] ]
)
run_func(functions_[0][0],functions_[0][1]);
Functions In A Certain Order
Problem:
I want to be able to run functions in a certain order from an array. The code below is a non-fat version of what I want to accomplish. The problem appears when the function(scream_name) runs. Flash makes the passed variables into one variabel; sname = "John", "Doe" and lname = undefined.
Anyone?
Code:
function run_func(func,vars){
func_ready = func(vars);
}
function scream_name(sname,lname){
trace(sname add " " add lname);
return true;
}
functions_ = new Array(
[ scream_name, ["John","Doe"] ]
)
run_func(functions_[0][0],functions_[0][1]);
Functions In A Certain Order
Problem:
I want to be able to run functions in a certain order from an array. The code below is a non-fat version of what I want to accomplish. The problem appears when the function(scream_name) runs. Flash makes the passed variables into one variabel; sname = "John", "Doe" and lname = undefined.
Anyone?
Code:
function run_func(func,vars){
func_ready = func(vars);
}
function scream_name(sname,lname){
trace(sname add " " add lname);
return true;
}
functions_ = new Array(
[ scream_name, ["John","Doe"] ]
)
run_func(functions_[0][0],functions_[0][1]);
Order To Functions In Actionscript?
Say I have something that looks like this:
play_again.onRelease = function()
{
clean_up();
setup();
}
Is there a way to make sure that clean_up() runs BEFORE setup() starts? As it is right now, they seem to be running simultaneously. My flash game doesn't have time to clean up all the loose ends before it starts again. When it runs the second time around, nothing works correctly because certain variables or movie clips haven't been reset.
Calling Functions In The Order I Want?
In a Layer I have 2 functions, function1() and function2().
I am trying to call these function from an another Layer, in following order:
function1();
function2();
But no matter what I do, Actionscript choose to call function2() before function1(). I find this very strange.
Something is wrong. Do you know what?
Thank you all for your help!
Initiation Functions During Playback
Hi, I frequently need to initiate functions during playback, for example for setting texts in nested mc's, and I using the empty mc with two frames, in one the action that initiates the function that defined in main timeline. I found this method by myself, but I am not sure that it's a right one.
Do anybody know the right method to do that? Note that I need to start some function without user's input or pressing button. I know that there is a possibility to write "on clip load", but is there another way?
Thanks in advance.
How Does MX Decide The Order It Exicutes OnEnterFrame Functions
Okay I'm programming this walking stickman using actionscript, and so far I'm very happy with it, but there's one little bug that I just can't figure out.
You can look at the SWF here. (Sorry I use freewebs, so you'll have to drag the link up to the adress bar. And the guy is controled by the left and right keys on the keyboard.
But anyway, if you look carfully, you'll notice that one of the guys toes is a frame late! I made it red so it's easier to spot. The other toe works fine, and they have identical code. But that red toe is always where it should have been last frame. It's very noticable when he runs fast, or if the framerate is lowered.
I've spent 2 hours fiddling with things trying to figure out the problem here, but I've got nothing. The t0 (first toe) function and the t1 (second toe) function are exactly the same, and one works and one doesn't. I've switched around the order of everything alot. I've deleted and rewritten things just to make sure I didn't make some kind of typo. Nothing.
Please help me.
Controlling Playback
I would like to know if there is a way to use a controller playback (fast forward and rewind) to control numerous swfs.
For example:
Main.fla holds the controller
Main.fla calls up several demos that play linearly.
there are six demos. the demo.fla is set up with movie clips on the main timeline(to control total frame #) -- otherwise the audio alone would make a demo over 16,000 frames (the macromedia flash mx 2004 limit)
now is there a way to have the main.fla fastforward and rewind these demos so that at the end of one, it jumps to the other and and the beginning of one you can rewind to the end of the previous? So that it rewinds and fastforwards inside the movie clips not the main timelines of the demos?
please help!
thanks
Controlling Playback
I would like to know if there is a way to use a controller playback (fast forward and rewind) to control numerous swfs.
For example:
Main.fla holds the controller
Main.fla calls up several demos that play linearly.
there are six demos. the demo.fla is set up with movie clips on the main timeline(to control total frame #) -- otherwise the audio alone would make a demo over 16,000 frames (the macromedia flash mx 2004 limit)
now is there a way to have the main.fla fastforward and rewind these demos so that at the end of one, it jumps to the other and and the beginning of one you can rewind to the end of the previous? So that it rewinds and fastforwards inside the movie clips not the main timelines of the demos?
please help!
thanks
Controlling The Playback Of My .flv
hi.
just managed to make my very own, very simple .flv-file from After Effects.
like it!
and so, I've set up my .fla to load and display the .flv:
Code:
var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var videoStream:NetStream = new NetStream(videoConnection);
var video:Video = new Video(700, 480);
addChild(video);
video.attachNetStream(videoStream);
videoStream.play("shine_introduction.flv");
now I'd like to fade the video in, as it begins, and fade it out again, when the video has played for 5 seconds.
I think I'll use Tweener for the fading.
so, I have to create a listener of some kind, that reacts, when the video starts playing, and a listener, that reacts, when the video has played for 5 seconds..
how do I do this?
thanks
felisan
Controlling Playback Of Movie
Hi, I created a little movie for an html page and now I would like to start the playback only when the whole html page is loaded. How can I do that? Thank you for your help.
Cheers
Controlling Movie Playback
can a cursor movement control a movies playback to reverse and forward?
eg cursor moves left movie plays forward, cursor moves right mpvie plays back
cursor on or off hit area movie stops or ciontinues to play for the same frame
Controlling Playback With Actions....
Okay, here goes. I'm attempting to create an interactive Flash piece in which I have four animations. I need the animations to play at different times (each one will have a button allocated to play it), and when it's run through, the page to return to normal. The page will have also contain a background image and 2 looped animations(movie clip symbols) that I want to run constantly throughout. The problem I've encountered is this...
I can make the playback head jump to a designated frame (i.e the beginning of one of my animations), but as the background image and 2 looped animations only exist in the first frame, they disappear when the head leaves frame 1.
I know that was a bit long winded, but it's hard to find stuff in books when you don't know what your'e looking for!
If anyone could give me a brief runthrough of how all or part of this idea could be achieved I'd be most grateful!
Cheers, Skratchfanatic
Controlling Playback With Actions....
Okay, here goes. I'm attempting to create an interactive Flash piece in which I have four animations. I need the animations to play at different times (each one will have a button allocated to play it), and when it's run through, the page to return to normal. The page will have also contain a background image and 2 looped animations(movie clip symbols) that I want to run constantly throughout. The problem I've encountered is this...
I can make the playback head jump to a designated frame (i.e the beginning of one of my animations), but as the background image and 2 looped animations only exist in the first frame, they disappear when the head leaves frame 1.
I know that was a bit long winded, but it's hard to find stuff in books when you don't know what your'e looking for!
If anyone could give me a brief runthrough of how all or part of this idea could be achieved I'd be most grateful!
Cheers, Skratchfanatic
Controlling Playback With Actions.....
Okay, here goes. I'm attempting to create an interactive Flash piece in which I have four animations. I need the animations to play at different times (each one will have a button allocated to play it), and when it's run through, the page to return to normal. The page will have also contain a background image and 2 looped animations(movie clip symbols) that I want to run constantly throughout. The problem I've encountered is this...
I can make the playback head jump to a designated frame (i.e the beginning of one of my animations), but as the background image and 2 looped animations only exist in the first frame, they disappear when the head leaves frame 1.
I know that was a bit long winded, but it's hard to find stuff in books when you don't know what your'e looking for!
If anyone could give me a brief runthrough of how all or part of this idea could be achieved I'd be most grateful!
Cheers, Skratchfanatic
Controlling Playback Of MC Via Button Within MC
I am trying to build a menu that drops down on release of a button. The menu has button links, and on release of one of these buttons I want the menu to fly up and disappear and go to the respective link. it seems simple but i can't get the menu to respond to the button. I've been stuck on this for a while.
Also I have a preloader but I'm not sure if it's working correctly. if someone could verify that it would be great.
The .fla file wont fit as an attachment on the forum; download it here --> http;//www.geocities.com/alpine_edge3/oddsound.fla (~450K)
Thanks in advance for your help.
-George Marzloff
Controlling Playback Of MC Via Button Within MC
I have a drop down menu controlled by an on release button and the menu has button links. When a user clicks a link i want the menu to jump back up out of sight and the movie will go to the appropriate destination. I can't get the link buttons to control anything; it may be a problem with the target paths. (the menu is located in the 'main' scene.)
Also I have a preloader as the first scene, but I'm not sure if it's working right. Could somebody verify that it works, and that the preloader doesn't wait to show up until the whole movie is downloaded?
Click the link for the .fla:
http://www.geocities.com/alpine_edge3/oddsound.fla
Excuse the weirdness of the intro.
Thanks for all help
-George Marzloff
Controlling Playback Of A Movie (MX)
I have say 4 buttons, they control a single time line of a movie instance
Lets call the instance frames_mc which has 100 frames
So Buttons A,B,C,D
What I want the buttons to do is controll the playback relative to where it is,
I have three things I need to be done
buttonb_mc onRollover gotoandPlay the Frames_mc movie from frame 50 onwards. (This one I can do)
a) buttonc_mc if frames_mc on frame 50 stop
if not on 50 gotoandplay 20
(So what is the code for determing if the playhead is on a certain frame on a movie clip? if FrameLoaded?
b) button d_mc if frames_mc on frame 50 then play next frame -1
(What is the code for playing a movie clip in reverse to a certain frame)
help is much appreciated.
Controlling MP3 Playback Using JavaScript
I have an AS3 MP3 player on a web page that uses the ExternalInterface.addCallback() method to playback mp3 files. The xml is generated dynamically and loads properly. I am able to toggle through the songs and play them from the MP3 player, however my efforts to communicate with the MP3 player from the web page are not working properly.
I am using swfObject to embed the swf movie on the page and the following code to trigger the playback from the page:
Code:
<a href="#" onclick="swfobject.getObjectById('mp3_player').playSong({entry_id},0);">
I could use some guidance on making this connection work properly. Any suggestions?
Thanks
Controlling 2 FLV Playback Components
Is it possible to control 2 different (but on the same frame) FLV playback components but from 1 flv playback controller.
We are trying to create a video of two layer, a back ground video , and a presenter with alpha transparency in front. The plan is to add a slider to turn the opacity of the presenter up and down.
I can make it work by embedding the two video on the flash time line, but would like to be able to have them as a progressive download using the FLV playback component.
Any advice help
Ps can you change the Alpha of a FLV playback component’s video , like you can if the video is in a movie clip.
Oh yer and I’m on Flash 8
Controlling Timeline Playback
Is there are a script that will run a swf file in reverse?
For instance, if the beginning of a movie zooms in on something, a button can run the zoom in reverse?
Any help on conrtolling timeline playback would be appreciated.
Thanks in advance.
NetStream & Controlling Playback
i am using a netStream'd object to play streamed video.
i have 2 ?s i want to ask about
1. thru lots of trial and error, i have found that if i have buttons that will control what FLV the netStream will stream, those buttons have to be on my root, with the object, and the netConn and netStream commands in frame 1. if my buttons reside in a movie clip or in a scroll pane, the audio will stream but not the video. so i put my object, and buttons on the root and my netConn scripts in frame 1 of the root and it works fine. i have also tried putting the scripts, objects and buttons all in the same movie clip, and that didnt work either. WHY IS THAT??! i have tried pathing to my buttons inside movie clips, and have had no luck.
2. this is the script that i also have in frame 1 on the root that is supposed to 'control' my streamed FLVs
rewind is instance name of rewind button, forward is instance name of fast forward button. both of these buttons (have to) reside on the root with the video object, which is named myVideo.
rewind.onRelease = function (){
mynetStream.seek(mynetStream.time - 5);
mynetStream.play();}
forward.onRelease = function (){
mynetStream.play(mynetStream.seek[mynetStream.time =+ 5]);
}
rewind stops the movie. it pauses and then does nothing.
forward does absolutely nothing at all.
what am i doing wrong?
mynetStream is the variable name associated with NetStream.
any ideas?!?!?!
Controlling Order In Which Images Get Loaded
Hi people
I am loading some images from an xml file into a grid.
because I am trying to make a dynamic grid with different sized images. I am using an eventListner to get their width properties.
The problem is that the order in which the images get to the eventlistner is different every time. This is a problem for me since my client is very specific in what order the thumbnails get loaded. What I plan on doing is to have a grid which had a restriction to the width. So I will load images and each time check if the sum of their length does not surpass the grid width. If it does I start a new row.
So is there a way to force flash to load the images in the order they are ordered in the XML file?
[F8] Movieclip Load Order? Please Help Functions Called Before Clip Is Loaded?
I have a custom dropdown im working on and im having some issues with load order and functions being called before they are loaded. Here is the situation:
Scenario 1:
An instance of the 'customDrop' is placed on frame 1 of the movie and assigned the instance name 'dropdown'. The actions for frame 1 are:
dropdown.addItem("Create New");
dropdown.addItem("Import");
dropdown.addItem("Example");
I have placed trace() statements in the contructor, and the onLoad sections of the dropdown (its powered by an external class) and here is the output:
DROPDOWN CONSTRUCT
ADD ITEM
ADD ITEM
ADD ITEM
CUSTOM DROPDOWN LOADED =======>
So as you can see the addItem is being called before the clip is loaded, so, the items are not added.... how do i fix this?!
Scenario 2:
Using the same setup as above, i placed an instance of the dropdown (with no instance name) on frame 1, then on frame 2 I placed another instance of the dropdown and named it 'dropdown' and attempted the same addItem commands.... same result, commands sent before clip is loaded.
Scenario 3:
identical to scenario 2, except I named the instance of the dropdown on frame 1 'dropdown' as opposed to no instance name, voila, it works:
CUSTOM DROPDOWN LOADED =======>
ADD ITEM
SELECT INDEX: 0 / Create New
hide drop!
ADD ITEM
SELECT INDEX: 0 / Create New
hide drop!
ADD ITEM
SELECT INDEX: 0 / Create New
hide drop!
===================
WHAT IS GOING ON HERE? Im tearing my hair out trying to figure this out.
I want to be able to just put instances of the dropdown on the stage, give them different instance names, and be able to call functions on them from the frame actions. How can I accomplish this? I have all the code in external actionscript files except for the actual "addItem" calls, which are on the frame level.
Additional Info: If i try using 2 dropdowns, i need to put both of them on frame 1 and give them instance names the same as on frame 2, otherwise they do not work.
PLEASSE HELPP
ps- the dropdown library item is set to export on first frame!
Mouse Position Controlling Playback Of Mc
from somebody who is a beginer of actionscript, does anyone know the script for:
there is a mc "animation" which is around 20 frames long and
is the full length of the movie (700pixels)
and i want it to play when i have my mouse on the right hand
side of the screen and reverse when on the left side and halt when in the mouse
is in the middle of
the screen.
ive tried searching for tutorials everywhere and i can only find them on when a
mc follows your mouse and doesnt actually play.
if anyone could help it would be great cheers
Controlling Movie Playback - Looping
Ok,
I have a mc about 20 frames long. I have put this clip on the main timeline and its all cool. I have, however an action on the last
frame which tells the playback head to jump back about a 100 frames and play again.
My problem is this. I need the looping to happen and continue to happen but I only want the clip I mentioned earlier to play once and stop on its last frame. How can I get this mc to only play once even though the playback head will keep on looping past it on the main timeline?
Any help much appreciated.
Thanks
Controlling Playback Of Flash Animation
this is a very simple question. i have a flash animation which is used by several web pages (main page and sub pages). however, i don't want the animation to play in the sub pages. is there a way of controlling the animation so that you can tell it to only play on certain pages?
it is a standalone .swf file in a html page. it there a way of passing in a parameter from the html to tell it when to play and when not to? any help would be appreciated. thanks
Controlling MC Playback (forwards/backwards)
Hello all! I'm Mr. Grifter and I'm new around these parts I'm also new to AS as it applies to playback control of a movieclip so here I am.
I guess I should start explaining the concept. In my file I have a movieclip (named FloorMovie) which animates a graphic of a building (over 2000px in height). At frame 1 the building's bottom floor is centered at the registration mark. At frame 17 a keyframe is create and the building's second floor is centered at the registration mark and so on every 17 frames for each floor.
Then I drop in motion tweens in the spaces between keyframes.
In the scene, I have buttons. The concept should be clear now: hit a button and the movieclips animates forward or backward and stops at the desired floor.
I have AS in the first and only frame of the scene and it contains the following:
Code:
elevSound = new Sound();
elevSound.setVolume(25);
function stepForward(MCFrame) {
if (FloorMovie._currentframe == (MCFrame-1)) {
stopAllSounds();
elevSound.attachSound("stop_elevator");
elevSound.start(0, 1);
FloorMovie.stop();
clearInterval(step_timer);
} else {
FloorMovie.gotoAndStop(FloorMovie._currentframe+1);
}
}
function stepBackward(MCFrame) {
if (FloorMovie._currentframe == (MCFrame+1)) {
stopAllSounds();
elevSound.attachSound("stop_elevator");
elevSound.start(0, 1);
FloorMovie.stop();
clearInterval(step_timer);
} else {
FloorMovie.gotoAndStop(FloorMovie._currentframe-1);
}
}
function goToFloor(TargetMCFrame) {
elevSound.attachSound("start_elevator");
elevSound.start(0, 1);
if (FloorMovie._currentframe<TargetMCFrame) {
var step_timer = setInterval(stepForward(TargetMCFrame), 30);
}
if (FloorMovie._currentframe>TargetMCFrame) {
var step_timer = setInterval(stepBackward(TargetMCFrame), 30);
}
}
... and in each button I have code similar to:
Code:
on (release) {
goToFloor(17);
}
where the 17 is the frame at which one of the floors is centered on-stage.
The funny thing is similar code worked when I had it stuffed into each button. It stopped working once I tried consolidating the functions and simplifying everything
Any assistance would be appreciated!
Thanks in advance
Controlling Playback Timing Of 3 Different Swfs? How?
I have a single html page that has three different swf files,
in three different table cells.
Is there a way to stably control the playback timing of the
three and keep them in sync, without making them one big
(big resolution-wise, not file size) swf?
They are basically all three small banner ads that transition
from one image to the next, but I want them to transition in
order and stayed synced up. Top banner goes, then a second
or so later right banner goes, then a second or so later, the
bottom banner goes, then repeat...
It needs to work on all the current browsers and also on both
the PC and Mac platforms...
Thanks in advance.
Behaviors:controlling Sound Playback
Hello, I need help with an animated door (button) I created. When I click on it I want it to open and play a sound. It opens fine when clicked on release, but the sound isn't working right. It plays right away when the flash file loads and plays opposite the time I want it to. (when the door is closed) The door button I have is a movie clip with another layer in it for the sound, so I thought both the animation and sound would react together when I applied the goto and play behavior to it. I applied the behavior in the main timeline. What am I doing wrong?
Controlling Mc Playback From The Main Scene...
Help!
I'm trying to get an mc symbol to playback different sections of itself in responce to a global variable changing.
Something along the lines of placing this within a keyframe on my actions layer of the main scene:
function init() {
If(x=1){
instancename.gotoAndPlay(20);
}
}
init();
However I can't seem to get it to work and I think it's got something to do with the way in which I'm targetting the mc, as if I place similar code within an onClipEvent(mousedown) of the mc and replace:
instancename.gotoAndPlay(20);
with
this.gotoAndPlay(20);
then I seem to get it working, etc...
Any help would be much appreciated as I've searched various forums and can't really find what I'm looking for!
Thanks for your time (from a proper newbie!)
Jon
[CS3] Controlling Sound Playback Speed
Hi guys. I was just toying around with trying to get a script that could control sound playback. I'm getting close, but the playback is very choppy.
Here's the first script I've came up with. It's almost working, but it is very choppy.
Code:
//AS2
SoundObj1 = new Sound();
SoundObj1.attachSound("testsound")
SoundObj1.setVolume(25)
frames = 0
fps = 33
everyframe = function(){
SoundObj1.stop();
SoundObj1.start(frames/fps, 1)
frames+=.5
//Playback speed should be halved.
}
onEnterFrame = everyframe
So I thought, okay, I'll just add an extra sound on top of the gap to bridge the choppyness, but it resulted in the same effect as above. Why wouldn't it? One sound starts and another stops... making it a needless extention on the previous script.
So finally I realised I would need 3 sounds over interval-looped frames to get the seamless sound effect I want...
Code:
//AS2
SoundObj1 = new Sound();
SoundObj1.attachSound("testsound")
SoundObj1.setVolume(25)
SoundObj2 = new Sound();
SoundObj2.attachSound("testsound")
SoundObj2.setVolume(25)
SoundObj3 = new Sound();
SoundObj3.attachSound("testsound")
SoundObj3.setVolume(25)
frames = 0
frameswitch = 1
fps = 33
everyframe = function(){
if(frameswitch == 1){
SoundObj2.stop();
SoundObj1.start(frames/fps, 1)
}else if(frameswitch == 2){
SoundObj3.stop();
SoundObj2.start(frames/fps, 1)
}else if(frameswitch == 3){
SoundObj1.stop();
SoundObj3.start(frames/fps, 1)
}
frameswitch++
if(frameswitch > 3){
frameswitch-=3
}
frames+=.5
//Playback speed should be halved.
}
onEnterFrame = everyframe
It seems slightly improved... but only very slightly. Any ideas?
~TheWaste
Preloading & Controlling Playback Of An External FLV
heya, now i should point out, im fairly new to flash/action script and im not the most compitant programmer so you'll have to bare with me if your answers/solutions take a while to sink in
ok, I'm trying to preload an external FLV file, but i'd like it to pause, so it loads while not playing. Now, I've tried using the FLV Importery thingy in Dreamweaver, and that stops the movie until the user is ready to press play, although i have no idea if its actually being downloaded, (i wouldnt have thought so as its not being streamed :? i dunno...) Ideally, i'd like to have it preloading, and use the FLV Playback component/functionality...
my code so far:
Code:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("arse.flv");
this.loaded_txt(this.getNextHighestDepth(), 10, 10, 160, 22);
var loaded_interval:Number = setInterval(checkBytesLoaded, 500, stream_ns);
function checkBytesLoaded(my_ns:NetStream) {
var pctLoaded:Number = Math.round(my_ns.bytesLoaded / my_ns.bytesTotal * 100);
loaded_txt.text = Math.round(my_ns.bytesLoaded / 1000) + " of " + Math.round(my_ns.bytesTotal / 1000) + " KB loaded (" + pctLoaded + "%)";
progressBar_mc.bar_mc._xscale = pctLoaded;
if (pctLoaded >= 100) {
clearInterval(loaded_interval);
}
}
the test page: http://www.theste.co.uk/kaka/pants.htm
Any help, suggestions, solutions would be great...
thanks
Ste
Controlling A Mc Playback With The Position Of A Mouse
from somebody who is a beginer of actionscript, does anyone know the script for:
there is a mc "animation" which is around 20 frames long and
is the full length of the movie (700pixels)
and i want it to play when i have my mouse on the right hand
side of the screen and reverse when on the left side and halt when in the mouse
is in the middle of
the screen.
ive tried searching for tutorials everywhere and i can only find them on when a
mc follows your mouse and doesnt actually play.
if anyone could help it would be great cheers
AS 2.0 - Controlling MovieClip Playback Issue
Hi,
Here's my situation:
------------------------
2 movieclips on the same layer on the root timeline: (instance name and linkage are the same)instance name: shards, 2 frames: labeled "default" and "stair"
instance name: shard_thumb, 2 frames: labeled "default_thumb" and "stair_thumb"
I am attempting to apply this code in the action panel of "shard_thumb":
Code:
onClipEvent (load) {
if (_root.shards.currentFrame == "default") {
this.gotoAndPlay ("stair_thumb");
stop();
}
else if (_root.shards.currentFrame == "stair") {
shards.gotoAndPlay ("default_thumb");
stop();
}
}
on (release) {
if (_root.shards.currentFrame == "default") {
_root.shards.gotoAndPlay ("stair");
stop();
}
else if (_root.shards.currentFrame == "stair") {
_root.shards.gotoAndPlay ("default");
stop();
}
}
The purpose is for when the movie loads, if the shard is in the "default" frame, the shard_thumb will display the "stair_thumb" frame, and vice versa if the shard mc is in the "stair" frame.
The other thing it must do, is if the shard_thumb mc is pressed while in the default_thumb frame, the shard mc will be set to the default frame label, and vice versa.
Thank you, and I hope this is not too confusing.
Looping Sound And Controlling Playback
I'm new to Actionscript and also new here. I've seen a lot of posts on this topic here and elsewhere, but forgive me, as I am having a hard time getting my particular Actionscript to work.
My goal is to have an external mp3 start playing by default, then continuously loop back to the beginning and play each time it reaches its end. All the while, I need to be able to play and pause the mp3 with buttons. So far, I believe I have everything working correctly EXCEPT for getting the sound to loop while retaining the functionality of my buttons.
Here's what I have so far:
ActionScript Code:
var soundReq:URLRequest = new URLRequest("15 Au Revoir.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var resumeTime:Number = 0;
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void
{
soundControl = sound.play();
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
}
function playSound(event:MouseEvent):void
{
soundControl = sound.play(resumeTime);
pause_btn.visible = true;
play_btn.visible = false;
play_btn.removeEventListener(MouseEvent.CLICK, playSound);
}
function pauseSound(event:MouseEvent):void
{
resumeTime = soundControl.position;
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
}
Any advice is greatly appreciated. Thanks!
Controlling Audio Speed Playback
Is there any way to speed up the playback of an audio clip. But I am not looking to skip frames, I need it to chipmunk the playback.
Controlling Audio Playback Speed?
Does anyone know if there is any way to allow the user to control the actual speed of audio? For example, be able to slow down or speed up an audio loop.
Appreciate any replies.
Thanks!
Controlling Streamed Video Playback
Does anyone know if you can assign controls through behaviours to 'progressively streamed video' or is it only available with embedded video?
If so, is there a way to control the playback without using a skin.
Thanks
Controlling Movie Clip Play Order
Good Day,
I have a web site that opens with two movie clips. One (A) folds open some navigation menus, the other (B) opens some rectangles that hold content. I want "A" to play out then, once it is played, I want "B' to start. It sounds simple but I cannot get the right code. I need something I can use for other applications in other pages. I have this code so far; (naigation_mc = "A" page01_mc = "B")
if (navigation_mc.play=true) {
page01_mc.gotoAndStop("start");
} else {
page01_mc.gotoAndPlay("start");
}
Perhaps there needs to be more code to controll this?
Controlling The Order Of Loading External Swfs
Hi All,
I have searched the site with no luck for finding out about this. It could be that using loops is the only way to do what we want, however ever the optimist I'll ask the question anyways.
Is it possible without looping to control which of 12 or so external swfs loads first when they all have to load on the same frame of the main movie?
For example, we have a main movie which creates classes where the class is itself in an external movie. When we load locally, the movies all load fast enough that the classes are created correctly, however when we move to loading from the server some of the class movies are not loaded into their levels before the main movie tries to create the class with of course the result being the class is not generated and the movies do not function correctly.
Any help would be greatly appreciated.
Liz
Controlling The Order Of Loading External Swfs
Hi All,
I have searched the site with no luck for finding out about this. It could be that using loops is the only way to do what we want, however ever the optimist I'll ask the question anyways.
Is it possible without looping to control which of 12 or so external swfs loads first when they all have to load on the same frame of the main movie?
For example, we have a main movie which creates classes where the class is itself in an external movie. When we load locally, the movies all load fast enough that the classes are created correctly, however when we move to loading from the server some of the class movies are not loaded into their levels before the main movie tries to create the class with of course the result being the class is not generated and the movies do not function correctly.
Any help would be greatly appreciated.
Liz
Statusbar/drag-handle For Controlling Playback
Hi,
Can anyone tell me how to make an action that shows a horizontal playback statusbar at the bottom of my scene, where I can allow the user to drag the handle to rewind or forward the movie in real time?
And happy newyear to all you nice people.
Ricki
Controlling Playback Of Animated Movie Clips
I have a movie consisting of two frames. Each frame contains a movie clip. The movie clips contain basically the same thing, but seen from different angles.
The user is given one chance to view the animation from a specific view (on frame 1 or 2) and toggle between the two views. After the user has chosen to view one movie clip, I want to make the movie clip stay at the "finished" position (i.e. stop at the frame at the end of the animation) for EACH different view. So, if the user is on frame 1 and views the movie, when they toggle to see the different view on frame 2, the finished animation of each should be showing (i.e. it should not animate each time they toggle through each frame).
I am currently controlling the viewing of the movie clips with a button that sets a variable = 1, thus playing the animation on the current frame. I also have a reset button, which sets all variables = 0 and sets the MC animations to their first frames for future viewing.
I tried setting the variables = 2 at the end of each clip and said "if var=2, loop at end of MC, else go to frame 1" but it doesn't seem to be working with the reset button (which sets the var=0).
Any help would be appreciated. Thanks...
If...then Problem Controlling Movie Clip Playback?
I have seven movie clips that need to crossfade with each other.
When you press one button it tells one clip to fade from 0 to 100 alpha using frames, but the problem is to tell the currently showing movie clip to fade down to 0 without disturbing the other clips.
I was thinking of using an IF...Then, but I'm not sure how to write the code correctly. Any help please!
Controlling Movie Playback Speed On Runtime?
Hi!
I tried to find a solution but didn't found so here i am asking for your help
I'd like to make a controller (+ and -) to change the movie playback speed. I guess i should change the frame rate to achieve the results i'm after?
The biggest problem is that i have movies in three different movie clips. The main movie and 2 empty movie clips that i'd like to be able to control from the main movie.
The greatest thing would be to be able to make a "floating layer" that would be over all the other movies.
Thanks in advance!
Controlling The Volume And Sound Playback Of Loaded Fla's
My main Fla is a small file with a holder movie clip that uses loadMovie(); to call in external Fla files. Each of these Fla files represents a music track and has said track embedded as a part of it. Is there any way whatsoever to controll the sound volume and play back of these loaded Fla files from within the main Fla file thats loading them?
Controlling Speed Of Audio And Video Playback ?
Hi!
I would like to know if there is (or will be) a way with upcoming Flash CS4 or even with Adobe Flash Player 10 capabilities (or even with Adobe Pixel Bender) to control the speed of an audio or video playback.
For example being able to play some sound slower or faster and even adjusting audio pitch (and other audio filtering).
It's been a while that I've been looking for this (back to Flash Player 6 when Flash was part of Macromedia) and with all progress achieved since then I hope there is some accelerate and decelerate feature now.
Please let me know about it.
|