473,583 Members | 4,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Actionscript In Buttons

2 New Member
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._current frame == "BioEnd", "PhotosEnd" , "MediaEnd") {_root.gotoAndP lay("BioStart") } else {_root.play()}}


Many Thanks
Daniel
May 1 '07 #1
1 2625
rmarsono
1 New Member
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._current frame == number1 || _root._currentf rame == "PhotosEnd" || _root._currentf rame == "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
1953
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 C++ source with its prototype UI/demo to be built in Flash). Can anyone provide examples or guidance for such an effort? More details:
1
1750
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 file. Please help me by telling me which website I should go to search for it. I thank you very much for your help. Regards, Karin.
6
2911
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 have the movie clip on the same SCENE as were i want to the button to take me? Does any one have any ideas as i am stuck and need help!!
1
1961
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 analysis on that shape (it's for an engineering website). Im new to both flash and c++ but i have used other programming languages before.
1
2481
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 like below? function showuserdetails(uname, uid, department, designation, contact) { locate.uname.text = uname; locate.uid.text = uid;...
0
1416
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. however, when i do the coding for one of the buttons, i realized that when testing on the device, all 3 buttons go to that particular page which is...
3
17951
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, but I really want an answer compatible to my software. (If i'm not mistaken it's actionscript 2.0) Also, does any of you know how the actionscript for...
0
2869
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 using firefox. I have managed to consume the service in Flex by using MXML like this: <mx:WebService id="wsTestWebService"...
3
1767
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 it brighter or darker, hopefully by controlling the color - brightness filter? via actionscript thanks, JZ
0
7894
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7825
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7933
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5700
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1431
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1155
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.