1 person found this helpful
a) Is there a way for me to set the actionscripting to a "parent" button then multi copy the button around the grid maintaining the scripting.
yes, but that's probably not what you want because each button will do exactly the same thing (unless you encode an if-statement that takes different actions based on the objects instance name). you'll probably want to use a for-loop to encode your buttons so you don't have much typing to do.
b) When a button is clicked, it goes out to paypal, is there a way to AUTOMATICALLY disable the button once the transaction takes place
and the user gets re-directed back to the website.
yes, as long as you setup flash and paypal to communicate when a transaction is completed.
c) When different buttons are clicked, is there a way to only have the URL of the last clicked button open up......in other words not have a whole
load of different pages to the same paypal account open. (EG. If I click 20 buttons, I don't want 20 links to paypal open, only the last clicked button)yes, but flash needs some way to determine a user has made the final choice.
Actually in reply to point a) what I need is for each button to perform exactly
the same task. The idea is that a purchaser buys a "virtual plot" of land on a grid.
Each plot has it's own button so the action on each button is identical.
Many thanks for the reply but as I stated earlier, I'm limited with my actionscript experience.
I was wondering if anyone had code that does similar tasks or if they could possibly direct me
towards fairly good tutorials. I've tried everywhere, and I'm an online subscriber to Lynda.com.
Any help whatsoever would be fantastic.
1 person found this helpful
ok, that means you'll have no way to differentiate which button was clicked and which plot was purchased.
as2 or as3? and what code do you want each button to execute?
Every button (850 of them approx) has a different instance name.
In actionscript 3, I then assign the paypal url to each different instance name.
I'm about 30% there and as you can imagine, it's a fairly onerous task, not to
mention the amount of lines of code in my AS3 file. The code that's being
executed is to navigate to paypal on the mouseclick. The idea is that you
click a button, navigate to PPal and make a donation.
There must be a way for me to do this in a much easier way ?
Is there a way for me to assign the URL to the instances globally
rather than having to copy/paste and edit each one individually ?
By the way, I really appreciate your input, many thanks.
if you've chosen the instance names wisely (eg, btn1, btn2, ..., btn850), you can encode them all using:
// if you've chosen those names unwisely so there's no pattern, you can use use an array and leveage a for-loop to minimize typing.
I will try that when I get home.
I do have the instances in a uniform convention (b001 - b850) so it looks like
your suggestion may work. Can't wait to try it.
I know I'm being cheeky here but if you had a little bit of similar code that I can
add on the end to lock out or disable the button, I would be seriously indebted
Also is it possible that when I disable the button (after it has gone through
the paypal process), I can show a graphic of a big red X or similar to signify
that particular button is now disabled.......
YOU HAVE NO IDEA HOW MUCH OF A HELP YOU ARE.
you can disable a button by using its enabled or mouseEnabled property. also, to indicate a button is disabling it's customary to use its alpha property: