Midframe variable

This is a discussion on "Midframe variable" within the Flash & Multimedia Forum section. This forum, and the thread "Midframe variable are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 12th, 2007, 17:38
Junior Member
Join Date: Nov 2005
Location: Wisconsin
Age: 38
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Midframe variable

I borrowed some code to create menu transition swfs in which as a button is pushed, it will look to see if the current swf is at midframe and if so, play the exiting animation of that swf and then load and play the intor for the swf for that button selection (hope that makes sense).

However, I have enhanced my swf files to have a number of stop actions for submenu items for that catagory so the swf does not automatically just play to the midframe and stop. Is there a way that I can modify the code so that if the swf is not at midframe yet, I can have it "gotoandplay" midframe if that makes sense?

Here's the code:

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "OrangeAll";
container.loadMovie("OrangeAll.swf");
} else if (_root.currMovie != "OrangeAll") {
if (container._currentframe >= container.midframe) {
_root.currMovie = "OrangeAll";
container.play();
}
}
}

Thanks,
Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 12th, 2007, 20:46
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Midframe variable

You could create a variable called currentFrame, and create a another if then statement around that.

var currentFrame:String();

Then at the beginning of your project make sure the variable is set to nothing, or some value.

Then when it does the release of the button, have it check the currentFrame variable and if it is not equal to "midframe"(or maybe undefined) then have it advance to that spot on the timeline with a goto command.

Also, at the "midframe" marker in the timeline (make sure to name the frame as a marker)v- make sure to have it set the variable currentFrame = to "midframe" so it changes.

Then it's just a if/then statement sort of like you've already created to check to see the value of the variable, and either go to the midpoint, or just play if it is already at the mid-point.

Make sense?
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 13th, 2007, 22:55
Junior Member
Join Date: Nov 2005
Location: Wisconsin
Age: 38
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Midframe variable

Hey, thanks for the advice. I'll give it a try and let you know!!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 18th, 2007, 19:05
Junior Member
Join Date: Nov 2005
Location: Wisconsin
Age: 38
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Midframe variable

Well here's what I tried to do. What I attempted was to modify my existing code slightly by adding another if statement:

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "OrangeAll";
container.loadMovie("OrangeAll.swf");
} else if (_root.currMovie != "OrangeAll") {
if (container._currentframe >= container.midframe) {
_root.currMovie = "OrangeAll";
container.play(); {
if (container._currentframe < container.midframe)
gotoAndPlay(midframe);
}
}
}
}

What I was hoping is that my last if statement is telling it that if the current played frame is less than midframe, goto and play midframe.

But it doesn't seem to work. Any ideas?

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 18th, 2007, 19:36
Junior Member
Join Date: Nov 2005
Location: Wisconsin
Age: 38
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Midframe variable

Well I tweeked it some more, but still no results...

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "OrangeAll";
container.loadMovie("OrangeAll.swf");
} else if (_root.currMovie != "OrangeAll") {
if (container._currentframe >= container.midframe) {
_root.currMovie = "OrangeAll";
container.play();
} else if (container._currentframe < container.midframe) {
gotoAndPlay(midframe);
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 18th, 2007, 19:43
Junior Member
Join Date: Nov 2005
Location: Wisconsin
Age: 38
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Midframe variable

Well I'm trying but still no luck...

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "OrangeAll";
container.loadMovie("OrangeAll.swf");
} else if (_root.currMovie != "OrangeAll") {
if (container._currentframe >= container.midframe) {
_root.currMovie = "OrangeAll";
container.play();
} else if (container._currentframe < container.midframe) {
container.gotoAndPlay(midframe);
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
swf transitions

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
variable classes CloudedVision PHP Forum 4 Feb 14th, 2008 03:07
Goto - midframe button problems Toby1979 Flash & Multimedia Forum 25 Sep 11th, 2007 21:21
is this variable right? geyids PHP Forum 4 Aug 6th, 2007 21:45
Passing a Variable to ASP Smog36 Flash & Multimedia Forum 1 Sep 13th, 2006 14:05
variable problems... tehrobot Flash & Multimedia Forum 4 Sep 13th, 2006 13:01


All times are GMT. The time now is 03:47.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42