473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Actionscript In Buttons

Hi everyone my name is Daniel,

I would like some help. I am using Flash 8 to build a website. I have built the whole site within one flash movie by building the different sections of the site (i.e. Bio, Photos etc) along different parts of the main timeline, with each section animated in and animated out.

My problem is I have the same set of buttons in a movie clip runnig through the whole flash movie. Because each section animates out I am having trouble in actionscript saying "on release play till this section animates out then play from the begining of the new section". I have written some actionscript but it doesnt seem to work. I am a novice at actionscript but if anyone can amend it, tell me where Im going wrong, or just think of a better way to do it I would be very greatful.

p.s. I have a layer where i have named the frames on the begining and ending of each section

This code is from the Bio button

on (release) {if (_root._currentframe == "BioEnd", "PhotosEnd", "MediaEnd") {_root.gotoAndPlay("BioStart")} else {_root.play()}}


Many Thanks
Daniel
May 1 '07 #1
1 2604
Hi Daniel,

There are two things that I think is wrong with your code there. I'm not an expert, but I think that _currentframe returns the frame number and not the label. Flash CS3 has a new attribute called _currentlabel, or something like it, which returns the current label name of a particular frame.

Another mistake you've made is the if() statement expression. To test an if() statement against multiple conditions, you need to use the following operators: || for "or" and && for "and".

Therefore, your if statement should read:
if (_root._currentframe == number1 || _root._currentframe == "PhotosEnd" || _root._currentframe == "MediaEnd")

By using || (or) you are saying that the actions contained within the if() statement will be executed if any of the conditions are true, whereas && (and) implies that all conditions within the if() statement would have to be met before the script contained within the if() statement is executed.

Good luck with your project, I know what it's like to be stuck when you're doing these things.

Rendy Marsono
www.bubblefish.com.au
May 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matt | last post by:
Hello, I am attempting to get a software prototype UI/demo built in Flash to talk with existing C++ (so I can exchange data and commands between the application-software already developed in the...
1
by: karin nguyen | last post by:
Hi, i am a new user for flash / actionscript. Now our lecturer asked us to do research for actionscript together with the flash file as example but I only can find the actionscript without flash...
6
by: P3dro0203 | last post by:
I have got a Movie clip that i have made in FLASH MX, and when i attach a actionscript to the button the hit CTRL + ENTER so veiw the SWF file, the actionscripting does not work. Is this becasue i...
1
by: Adam Chapman | last post by:
Hello, I am trying to make an application with a flash interface which does calcultaions in the more powerful c++. Basically I want to be able to draw a shape in flash and do some structural...
1
by: Rocky86 | last post by:
hi ppl bascially I am require to pass my php coding to actionscript and the actionscript will seperate the code of my php how do I do it? Must I create a function for php to be pass into actionscript...
0
by: bellmiko | last post by:
Hi.. I am currently developing an Infotainment application for my school project on mobile applications. My problem is, from my main menu i have 3 buttons each supposing to link to 3 different pages....
3
by: JuneNasch | last post by:
Hi. I'm a beginner in using Actionscript. Do you know what is the actionscript for a button to exit or quit my project? I'm using Flash 8 pro. I don't know which version of actionscript is used,...
0
by: gabrielk43 | last post by:
Hi I am new to Flex and I use Flex Builder 2 to make a web service client. So I have a web service in .NET(c#) with a simple web method that returns a string(no arguments). It works, I tested it...
3
by: jztheillest | last post by:
Hi, I'm trying to control the brightness of an image through action script that would be in turn controlled by buttons. So, on the on(release) handler How would I attach a code that would make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.