Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Playing Frames Inside A MC



I want to make an action to a frame that when i press SPACE a MC changes from frame 1 to frame 5 for example.
in frame on of the scene comes the movieclip. I edit the mc so that there are 5 frames each one is different. I put stop () in each of the mc´s frames.
Now to the frame where the mc is located in i put the actionscript:

if (Key.isDown(Key.SPACE)){
//here comes the code that makes the mc go to frame 5 inside the mc. get it?
}


help!



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-25-2001, 08:23 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Playing Frames Inside A MC Inside A MC That Is Inside A MC
much like the title says. how do i put code in the main timeline

such as
gotoAndPlay(x)

x refering to a a frame inside a MC inside a MC. thx for any help

Looping First 38 Frames 7 Times, Then Playing The Whole 76 Frames And Stopping
Hi Guys, I have a movieclip that the first half has one set of movements, but the second half changes. I want to be able to loop this movieclip (instance on the root), so that it plays the first 38 frames 7 times...i.e., loops 7 times, and the 8th time, it plays the whole clip, then stips...the movie is 76 frames long.

I know it's going to be...make i=1 first time...add 1 to i each time...and if i=7, then play past frame 38...and put a stop(); at the end of the movie, but i don't know how that code would look, if I could please ask for more...basic (ugh...) help...
In other words, how do I write this (pseudocode) in AS:

i=1
play frames 1-38
i=i+1
if i is less than 8, play frames 1-38
if i is more than 7, play the whole movieclip, all 76 frames


Shawn

Playing Certain Frames
I have been trying in flash to play a certain amount of frames then for it to change scenes when i push a button. For example, if i were to click on a button it would play frames 240-250 and at frame 250 the movie would start playing scene 2

Ive tried everything i knew, but that doesnt seem to be enough ^_^. I would appreciate any help that you have.

Thanks

Playing Frames
Kind of carrys over from my last problem

I have multiple frames now with code in each of them

Ive done gotoAndPlay() to send the current frame to a new one, but it wont play untill ive right clicked and selected play, what could be the problem?

Playing A Few Frames Of An SWF
Hi, I have a problem that I suspect is easy to solve but I've had no success so far.

I have an SWF (created from an MPEG in Squeeze) that is divided into short bursts of static.

I have a number of buttons which when pressed should play an individual burst from the SWF (which is subsequently removed/hidden) before a new external movie is loaded.

For example button 1 plays frames 1 - 13 of the static SWF and then loads movieclip1.swf

button 2 plays frames 14 - 26 and then loads movieclip2.swf

etc etc...

Can anybody give me some pointers?

Thanks, in advance.

Playing Certain Frames
any ideas how to get a movieclip to only play specified frames, for example. i have a mc on the stage with 100 frames. I only want it to play 30-50. ???

Playing Random Frames
Argh. I used to have the string of code which plays random frames of a movie clip, but I lost it. And I can't remember what it was.

Help please...
Do any of you know this action script code offhand?

Playing Frames In Reverse
Hi all

Does anyone know how to add an action script to a button that plays a sequence of frames in reverse? At the moment I have one button that scrolls an image one way and I want to be able to have another button that reverses it the other way.
Probably something v. simple but am a bit of a Flash beginner!

Many Thanks

Mike

Frames Not Playing Righ
I posted this about 5 days ago, Gemein told me that the problem might be with the "release" include in my mouse event, but that didn't solve the problem. Please read on and post a reply if you know how to fix this. Thank you.

I'm not really good at describing my problems, but here goes.
I made a button roll over effects. The script for my goes like this:
on (release, rollOver) {
francais = "true";
gotoAndPlay (2);
}
on (release, rollOut) {
francais = "false";
gotoAndStop (1);
}

the action ends on frame 15 which has the following script:
if (francais = true) {
gotoAndPlay (2);
}

and I have another button with the following script:
on (release, rollOver) {
programs = "true";
gotoAndPlay (16);
}
on (release, rollOut) {
francais = "false";
gotoAndStop (1);
}
and on frame 30:

if (programs = true) {
gotoAndPlay (16);
}


The problem is, my "programs" button will play the effects correctly, but my "francais" button will play up to frame 5 instead of up to frame 15 and then back to 2.
Thanks for your time and efforts.

Really Need Your Help Playing A MC Or Frames Before Starting Another MC,
Except from the original button that instigated the process in the first place. So the 'intro' part cannot trigger the new MC, this has to be done from the original button, but how do you do this with Actionscript?

Picture this:

some thumbnails/buttons and a photo framework in which when clicking the thumb, the bigger image should appear.

still there?
ok.

I want the images to slide into the framework... but before a new image replaces the old one, I want the old one to slide away (basically just a square with the bgcolor sliding back over --- i'll refer to this as the slide-out), but this has to happen whenever you choose a new image....

so:
I click, image slides in and centers
I click thumb2, on top of current image a bgcolored square + line 'cover' the image till only the bg is again visable.
Image2 slides in.

and so on.

What would you advice me and how?
- either make a 'slide out' in a independent MC which can be positioned on top of the current image (and if possible, how do you position like layers in actionscript?)

- or create a slideout in the same MC as the slide-in + the actual image... the movieclip should be then something like this: slide in tween > the image > the slide out tween.

But how do you do that with actionscript, so basically after the image there is a stop action, but onclick of some other button, first the frames of the slide-out are being played, before Flash starts loading the next image MC.
And obviously it has to work that people can choose the image at random, so no fixed order

Is this easy or what

Thanks again!

Playing Frames Backward
I have an annimation with two buttons one goes to the next approaite frame the other goes backward.

For the forward buttons I am just using the GotoAndPlay fuction, but how do I make the back button play the frames backward?

Any help would be grand!

Cheers

Jemes

Playing Ramdom Frames Within One MC
Hi all, here is my problem.

I have a movie clip ('characters') with 5 frames. Each frame is a movieclip containing a certain animation.

When the 'characters' movie clip is loaded I want it to goto and play one of the first four frames at random. When that nested movie has finished playing I would like the 'characters' movie to then choose another of the first four frames at random. This process needs to go on forever.

However when a button is pressed (it sits within the character movie clip)I want this cycle to be broken and for the 'characters' movie clip to goto frame5. This is an information frame with an exit button on it. When the exit button is pressed I need the 'characters' movie clip to resume its random cycle......

All help is greatfully recieved as this problem has really got the better of me. I'm using Flash5.

Not Playing Clip At Certain Frames
ok, in the linked .fla, the "links layer" is supposed to bring out the menu in an appear/move motion. cept it's not working =-P any suggestions? also linking what it's supposed to do, this didn't happen till I added more frames for different menus in same clip, not sure if that's what the problem is or not tho...

Playing An MP3 Independent Of Frames
I am modifying the basic slideshow that came with MX. I would like to have an MP3 play along with the slideshow. However, if I attach it to the first keyframe everything is fine until the slideshow arrives back at the first frame at which point a second copy of the MP3 begins playing over itself. This also happens if I hit the back key and traverse the first keyframe. I tried adding a separate scene independent of the slideshow keyframes but that didn't work.

How do I load an MP3 to play independent of the current frame? Is there an "onload" function in Flash?

Thank you,

Seth

Playing A Range Of Frames
Hi

I am building a bar chart graph.

All is going well, I have built the graph - all the axis and bars are in place and all variables load in from my ASP page.

Each bar is a separate movie clip containing 100 frames, each frame representing 1% of the graph results. I have 5 bars and when the scene loads I want each bar to move to the frame corresponding to the value pulled in from the ASP file.

So if the ASP file values are 10 and 90 the first two bars will move to frame 10 and frame 90 respectively. I want the bars to move up the screen animated as in the motion tween, not just jump to that frame

The difficulty I am having is getting each bar to play until it reaches a specific frame, not gotoAndStop().

So if the value for the first bar is 50, I want the move clip called bar_1 to play until frame 50 and then stop.

As I said earlier I can load the variables fine, just need help making a movie clip play a specific amount of frames and then stop

At the present I have this for the actions on each bar, but using the gotoAndStop it will jump straight to the frame given, not play each frame upto a number and then stop:

onClipEvent(load)
{
loadVariables("poll.asp",this);
}

onClipEvent(data)
{
/* votes1 is the value from the asp */

var v1 = Number(votes1);

this.gotoAndStop(v1);

}


Thanks

Dean

Playing Frames In Reverse?
I have a movie clip that I am wanting to play in reverse, can anyone help me with this?

Playing Frames In Reverse
Hi everyone,

I'm not sure how to attack the problem I'm having (I've considered a baseball bat...) so I was wondering if someone could help me out.

Here's the deal: I have a series of buttons, and above them is a navigation bar. As I hover over a button, I want a second bar to slide out from behind this top bar, with the mouseover text on it. When the user stops hovering over a button, that bar slides back from where it came. This happens with each button, with a different word on the bar depending on which button they're hovering over. I can do all of this, except I want the bar to slide back to its starting point from where it is as the time.

To clarify, I can make the bars slide out, but what happens if someone stops hovering before the bar slides out fully? I want it to retract from the position it's at, at THAT TIME. I have no idea how to achieve this and I'm assuming it involves ActionScript but I'm really a complete novice when it comes to any kind of programming.

I found this very hard to explain lol. But any help or questions for clarification would be appreciated greatly. Thanks.

Playing Frames Out Of Sequence
how would i go about creating a script to play frames that are not one after another..and not in any ordered sequence?


thanks,

deerfield

Playing Frames In Reverse.
Ave,

I'm trying to find a simple solution to this problem.

I have a Mask Layer and a couple of layers beneath it. Within a span of 600 frames, the animation is simple. Photos transition in and out of each other.

As it is a continous animation, all i want to do is that when the header reaches the last frame, it plays back in reverse. When it reaches back the first frame, i can always put "gotoAndPlay(2);" and thus forming a loop.

I "can" of course Copy all 600 frames, Paste them, do "Reverse Frames" and have a 1200 Frame animation. But i'm sure there is an ActionScript way to do this.

Any suggestions?

Thanks.

Playing Random Frames
I'm trying to make make my quiz game play ramdom frames and not play the same frame twice.
I found this on another forum but Im not sure how I can use it the way im doing things

this is written on the first frame,
-----------------------------------------------

Code:
[as:1:e3373511da]mc.onRelease = function()
{
this._parent.random_frame();
}


var frames = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ]
function random_frame()
{
var c = frames.splice(random(frames.length), 1)
mc.gotoAndStop(c)
trace(frames.length)
}
[/as:1:e3373511da]
My que to send the playhead to the next frame is at the end of an animation on the timeline.
Would I just use write the array and splice var then call it at the end of my animation? like
-------------------------------------------------
on frame one
-------------------------------------------------

Code:
var frames = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ];
function random_frame();

var c = frames.splice(random(frames.length), 1);
-------------------------------------------------
on my animation timeline que
-------------------------------------------------

Code:
_root.gotoAndPlay(c);
-------------------------------------------------

am I on the right track?

any help would be much appreciated.

Mark

Playing Back Two Frames?
Hello Everyone,

I'm currently using

stop();
_root.prevFrame();

to go back one frame. I've run into a situation where I want to go back two or maybe three frames. How would I script this?

Thank you,

Liz

Reverse Playing Frames
Hi-

I have a small flash movie that i actually need to play backwards instead of from frame 1 - 240 - it needs to play from frame 240 to 1 and stop.

this code is working, except it keeps looping and i can't figure out how to stop it after it plays from 240 to 1 once.:

forward = true;
onEnterFrame = function () {

if (forward == true) {
nextFrame();
} else {
prevFrame();
}

if (_currentframe == _totalframes) {
stop();
forward = false;
}
if (_currentframe = 1) {
forward = false;
}
};
gotoAndPlay(240);





Thanks in advance. It's a bizarre problem but this will save me alot of time if i can get it doing this.
Shawna

Playing Frames In Reverse.
I have been trying to figure out how to play a series of frames in reverse. Originally I had a movie clip, that was unwieldy at best so I broke it into frames. I'm still learning, so watch there be some ridiculously easy function like "playinreverse" or the like. Here is the code I have thus-far. The italic text is the function I'm working with, but I included the rest... just in case.

As it stands now I can click the button (only Podcast is coded at the moment) and it will reverse exactly 1 frame. Once I do this 29 times it gets back to the first frame and plays like it is supposed too. I'M SO CLOSE! grr.

Am I missing somethings simple.

gotoAndPlay("Main");
stop();

function playmain (event:MouseEvent):void
{
gotoAndPlay("Main");
}

function playpodcast (event:MouseEvent):void
{
var i = currentFrame;
var j = Math[currentFrame - 29];

if (i != j)
{
prevFrame();
}
else
{
gotoAndPlay("Podcast");
}

}

function playportfolio (event:MouseEvent):void
{
gotoAndPlay("Portfolio");
}

function playresume (event:MouseEvent):void
{
gotoAndPlay("Resume");
}

function playcontact (event:MouseEvent):void
{

gotoAndPlay("Contact");
}

Main_btn.addEventListener(MouseEvent.CLICK, playmain);
Podcast_btn.addEventListener(MouseEvent.CLICK, playpodcast);
Portfolio_btn.addEventListener(MouseEvent.CLICK, playportfolio);
Resume_btn.addEventListener(MouseEvent.CLICK, playresume);
Contact_btn.addEventListener(MouseEvent.CLICK, playcontact);

Playing Frames In Reverse
Hi=

i need this flash piece to playin reverse.
So it needs to start on frme 240 and play backwards 10 one. (reverse frames won't work in this instance)
Tis code is working, but it keeps looping. Can't get things to stop when it gets to frame 1.

help!

Shawna


Code:
gotoAndPlay(240);
forward = true;
onEnterFrame = function () {
forward ? nextFrame() : prevFrame();
if (_currentframe == _totalframes) {
stop();
forward = false;
}
if (_currentframe == 1) {
forward = false;
}
};

Playing Random Frames
I have a password field and a enter button. There are certain passwords that are specified in order to get to the secure area. I want the user to be able to click a get password button and one of the passwords is randomly displayed in a popup window. That is where the problem is. How do I randomly select frames in a moviclip by clicking a button?

Frames Not Playing Correctly
Hi!

I'm experiencing a strange phenomenon with my movie. Here's the scenario:
The main timeline has 3 frames. Each frame has a register button, a contact button and a home button.
Frame 1 contains a movieclip that initially runs and is triggered on release of the home button.
Frame 2 contains a movie clip that is triggered on release of the contact button.
Frame 3 contains a movie that is triggered on release of the register button.

I have stop(); statements at the end of the movieclips on frame 2 and 3. The movie clip on frame 1 loops.

Each button runs the correct movie clip when pressed the first time but when pressed a second time each button runs the next movie clip in "line".
eg. If I click contact it goes to contact movie clip and plays it and stops. From within contact_mc , if I click the contact button, MOVIE CLIP 1 on the main timeline plays!!!
I have specified _root.gotoAndPlay for each button event, so shouldn't it always play the corresponding frame on the main timeline?

I don't know if this is clearly explained, but I sure would appreciate some feedback.
Thanks!

-Vera

Playing Frames Only When Certain Criteria Are Met?
I hope I can explain this well.

First, here's the movie in question:
http://www.pseudodigm.com/testing/voip.swf

the fla is here: http://www.pseudodigm.com/testing/voip.zip

The concept is, you have this big picture and when you hover over a label the picture zooms in and you get a detail.

Problem is, say you're hovering over "Operations" then you just move your mouse down to "Customers". The movie sorta stutters over from Operations to Customers. What I would LIKE it to do is act as if I had removed my mouse from the button, THEN hovered over the next item.

Ie:

1. User sees big picture

2. User hovers over "Operations"

3. Movie Zooms In to Operations.

4. User hovers over "Customers"

key -->5. Movie zooms all the way back out, THEN zooms into "Customers"

so on...

I hope this makes sense.


So far I've tried to put a switch into the frames where the movie is zoomed all the way out. something saying "ok, we're ready to zoom in" then have the buttons say "if the frame says "we're ok" then we can zoom in". But that didn't work for me.

Help?

Pseudo

Playing Frames Backwards W/as
I'm making a new section tto my site and I'm adding a 3d object that rotates 1 way when you prees DOWN and the opposite when you press UP. I was made in Swift, so it is in frames. Basicly I want it so when the user presses down, it will play the frames normaly until it reaches a stop(); command and when down is pressed, it'll play the frame backward until it reaches a stop(); command.

Playing Specific Frames Only?
Hey all,

I'm trying to loop only five or so frames from an entire movie clip, and I'm not quite sure how to do this.

Basically I have a man walk in and sit down as an intro scene (frames 1-6), and then from there playing just looping the 'sitting' animations (frames 7-11) until the user does something with the interface. can someone point me to a tutorial or help me out?

Thanks.

Playing Backwards Through Frames
I'm having a bit of a problem with getting the timeline to play backwards through frames. I've tried doing something like the following and thought it should've worked but it didn't, and I need some help with this plz:

function onEnterFrame() {
gotoAndPlay(lastframe);
lastframe = _currentframe--;
}

Thanks

Playing Frames (images) With XML
I am working on this XML slideshow tutorial, and it only goes to the next frame when you use the next button, how would i change it that it goes to thenext frame automaticly?

what I am trying to achieve is a turntable which gets the images of the frames out of an external folder throug XML, but I cant even get this to work


Code:

next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
break;
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};

Frames Not Playing Correctly
Hi!

I'm experiencing a strange phenomenon with my movie. Here's the scenario:
The main timeline has 3 frames. Each frame has a register button, a contact button and a home button.
Frame 1 contains a movieclip that initially runs and is triggered on release of the home button.
Frame 2 contains a movie clip that is triggered on release of the contact button.
Frame 3 contains a movie that is triggered on release of the register button.

I have stop(); statements at the end of the movieclips on frame 2 and 3. The movie clip on frame 1 loops.

Each button runs the correct movie clip when pressed the first time but when pressed a second time each button runs the next movie clip in "line".
eg. If I click contact it goes to contact movie clip and plays it and stops. From within contact_mc , if I click the contact button, MOVIE CLIP 1 on the main timeline plays!!!
I have specified _root.gotoAndPlay for each button event, so shouldn't it always play the corresponding frame on the main timeline?

I don't know if this is clearly explained, but I sure would appreciate some feedback.
Thanks!

-Vera

Playing Frames Only When Certain Criteria Are Met?
I hope I can explain this well.

First, here's the movie in question:
http://www.pseudodigm.com/testing/voip.swf

the fla is here: http://www.pseudodigm.com/testing/voip.zip

The concept is, you have this big picture and when you hover over a label the picture zooms in and you get a detail.

Problem is, say you're hovering over "Operations" then you just move your mouse down to "Customers". The movie sorta stutters over from Operations to Customers. What I would LIKE it to do is act as if I had removed my mouse from the button, THEN hovered over the next item.

Ie:

1. User sees big picture

2. User hovers over "Operations"

3. Movie Zooms In to Operations.

4. User hovers over "Customers"

key -->5. Movie zooms all the way back out, THEN zooms into "Customers"

so on...

I hope this makes sense.


So far I've tried to put a switch into the frames where the movie is zoomed all the way out. something saying "ok, we're ready to zoom in" then have the buttons say "if the frame says "we're ok" then we can zoom in". But that didn't work for me.

Help?

Pseudo

Playing Frames On Dif Level
Can anyone tell me how to play a frame in a movie which is loaded on another level of my main movie. For instance: in my main movie I have movie2.swf loaded on _level1. Before i unload movie2.swf i want to play a few frames at the end.

Sorry if this is a really basic question - I'm still struggling with working with movies on dif levels.

thx in advance for any help.

Playing Frames Backwards
I have an annimation with two buttons one goes to the next approaite frame the other goes backward.

For the forward buttons I am just using the GotoAndPlay fuction, but how do I make the back button play the frames backward?

Any help would be grand!

Cheers

Jemes

Playing Multiple Frames
Hi, I was wondering, how do I get a button to play a frame label, then play a different one after that?

So it would be, 'User clicks on button' --> loads a frame I have labeled --> after that has finished playing, --> goes to a different frame I have labeled.

Hope this makes sence and someone can help me.

Cheers

Playing Only Next 5 Frames Without A Stop Action
Hello

Anyone ever tried getting a button to tell a MC to play the next 5 frames and stop? is that possible? I can't put a stop action in the movie clip because of how have this game/site set up.

any help or direction would be appreciated

cheers,

nigel

Playing Frames In Reverse Order...
I would like to play a certain section of frames in my scene in reverse order after an "on release" action is initiated. Any comments would be appreciated.

Ben

Playing Only Specific Frames Problem
I've searched on the forums and have not found a solution so hopefully this isn't too much of a request for help.

On my main timeline I have a movie clip which within it consists of a 60 frame animation. Now on the main timeline are buttons which when clicked I would like to play that movie clip.

Now here is my problems or questions. If you press, say button 1 it will play the entire animation. Now if you press button 2 I would like for it to play only the first 30 frames and then stop and stay at frame 30 of the animation. From what I gather I don't think there is a stop command in the mc on frame 30 or the button 1 function would never play all 60 frames. I have the button 1 code to be:
on (release){
_mc.gotoAndPlay(1);
};

button 2?
on (release){
_mc.gotoAndPlay(1);
if(30){
stop();
}
};

Please help I am at a loss.

Movie Clip PLaying After So Many Frames.
I have a movie clip of a plane, and i would like it to play every couple of hundred frames. Whats the script for this?

Much Love,
Ben.

Controlling MC Timeline - Playing Certain Frames
Is it possible to only play lets say frame 10 to 20 in a MC which holds 40 frames?

Mads

Playing Few Frames Of Movie Clip
i want to play only frames 5 to 12 of a movie clip on mouse click. how do i do that. how do i know when i am done playing those frames?

Playing Frames In The Revers Order?
Hi all

Is it possible in flash (or swish or any other application) to play the frames in the reverse order?

For example can we make a button which plays the frames beginning from 50 to 10?

Frames Inside An Swf?
i mean frames as in a www site. is it possible? that would be *****in... if not, we should suggest it to macromedia for the next release. Happy Flashing

Playing An Swf, Inside Another Swf
is there any way to play an swf, inside another swf? if there is a way please tell me and the code. Thanks for the help!

Swf Playing Inside A Swf
OK, here goes. Ive posted on another forum without any solution. I am somewhat of a noob in actionscript 3. I am creating a swf player from a parent swf that is navigated by the photoflow component at flashloaded. So the loader plays swfs based off of selections in the component. it also detects if a swf is done playing and starts the next. The following is my code to accomplish this:


Code:
import com.flashloaded.as3.PhotoFlowEvent;

myPhotoFlow.autoFlipDelay = 4;
myPhotoFlow.photoAngle = 10;
myPhotoFlow.selectedReflectionAlpha = 65;
myPhotoFlow.reflectionDepth = 40;
myPhotoFlow.selectedReflectionDepth = 45;
myPhotoFlow.selectedY = 15;
myPhotoFlow.motionSpeed = 4;
myPhotoFlow.distance = 5;
myPhotoFlow.spacing = 100;
var swiffIds = new Array();
var swiffThumbs = new Array();
var swiffPaths = new Array();
var index:Number = new Number(0);
var temp:Number = new Number();
var closeVid:Number = new Number(1);
var loader:Loader = new Loader();

LoadSwiffys(closeVid);

function swiffysLoaded()
{
var url:URLRequest = new URLRequest(swiffPaths[index]);
//var loader:Loader = new Loader();

loader.load(url);
addChildAt(addChild(loader), 1);

//start loading.swf
var loadingurl:URLRequest = new URLRequest("loading.swf");
var loading:Loader = new Loader();
loading.load(loadingurl);
addChildAt(addChild(loading), 1);

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
//trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
loading.unload();
//trace("Complete");
var i:Number = new Number((MovieClip(loader.content)).totalFrames);
//trace(i);
(MovieClip(loader.content)).addEventListener(Event.ENTER_FRAME, nextVideo);
}
//event listener for click on a thumbnail
myPhotoFlow.addEventListener(PhotoFlowEvent.CLICK_SELECTED, photoClick);
//myPhotoFlow.addEventListener(PhotoFlowEvent.SELECT, photoClick);


function nextVideo(event:Event):void {
if ((MovieClip(loader.content)).totalFrames == (MovieClip(loader.content)).currentFrame) {
(MovieClip(loader.content)).removeEventListener(Event.ENTER_FRAME, nextVideo);
loader.unload();
temp = index + 1;
if (temp == swiffPaths.length) {
index = 0;
myPhotoFlow.setSelection(0);
} else {
index++;
myPhotoFlow.next();
closeVid = 0;
}
swiffysLoaded();
}
}
function photoClick(eo:PhotoFlowEvent):void {
var len:Number = swiffThumbs.length;
for(var t=0; t<len; t++){
myPhotoFlow.removePhoto(0);
}
index = 0;
var vidNum:Number = (eo.data.desc);
//trace(vidNum);
(MovieClip(loader.content)).removeEventListener(Event.ENTER_FRAME, nextVideo);
loader.unload();
LoadSwiffys(vidNum);
}
}

function addPhotos() {
var len:Number = swiffThumbs.length;
for(var r=0; r<len; r++){
myPhotoFlow.removePhoto(0);
}
//var len:Number = swiffThumbs.length;
for(var t=0; t<len; t++){
var obj1:Object = {name:swiffIds[t], desc:swiffIds[t], url:swiffThumbs[t]};
myPhotoFlow.addPhoto({name:swiffIds[t], desc:swiffIds[t], url:swiffThumbs[t]}, t);
//trace(swiffIds[t]);
}
//myPhotoFlow.addEventListener(PhotoFlowEvent.CLICK_SELECTED, photoClick);
}

//////////////////////////Functions to load swiffys///////////////////////////////////
function LoadSwiffys(closeVid)//eventually,pass the IP and refer in here
{
var request:URLRequest = new URLRequest("http://192.168.1.172/newsite/loadswfs.php?click=" + closeVid);//and send ip and refer here too
var variables:URLLoader = new URLLoader();
variables.dataFormat = URLLoaderDataFormat.VARIABLES;
variables.addEventListener(Event.COMPLETE, completeHandler);
try
{
variables.load(request);
}
catch (error:Error)
{
trace("Unable to load URL: " + error);
}
}
function completeHandler(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
var variables:URLVariables = new URLVariables(loader.data);
swiffIds = variables.swiffId.split(",");
swiffPaths = variables.swiffPath.split(",");
swiffThumbs = variables.swiffThumb.split(",");
swiffysLoaded();
addPhotos();
}
When i run it in the output window I get an error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MethodInfo-394()

I have been told that it might have something to do with this line:

(MovieClip(loader.content)).totalFrames == (MovieClip(loader.content)).currentFrame

but im not sure. Its not a huge deal because it still functions correctly, except most browsers throw an error and stops the play. Does anyone know what might be wrong? or if you dont know, is there a way to supress the output so this error does not come up on browsers? Thanks for the help.

Jumping Scenes And Playing Frames-urgent
can anybody explain this to me?

i've got a little cut-scene in the end of my main scene where a "shutter" closes over my interface.

the nav. buttons on the bottom of my interface let you go from scene to scene...

I want the a particular nav button to advance the main scene to the next set of frames (the cut scene) and then load the scene that corresponds to it.

this is what i have for the button right now... it doesn't work... maybe it's not correct actionscript, maybe it's going down the wrong path altogether....

on (release) {gotoAndPlay(81);

if (_currentframe=108) {gotoAndPlay(login,1);

}

HELP!!!!!

-thanks in advance for your input

Playing Selected Frames Then Skipping To Another And Stopping
ok, i need to program some buttens so they will play the next 10 frames or so, and then skip directly to another frame in the movie clip and stop. what scripting would i use in the buttens??

Playing Random Frames In A Movie Clip
I have got a movie clip with 32 frames. When the movie is loaded how can I make it play frames at random?

Copyright © 2005-08 www.BigResource.com, All rights reserved