Multiple event handlers for one button
I'm trying to create a button with 2 event handlers, such
that when you roll-over the button, a submenu pops up, and when you
click the button, you go to a certain frame. I feel like this
shouldn't be hard at all, but it's not working. Below is the
actionscript I have tried. Both event handlers work as I want them
to if alone, but the on(release) functionality does not work when I
try to put them together.(I have Flash 8). Thanks for your help!
on (release) {
_root.gotoAndStop("one1");
tellTarget (_root.navigation) {
gotoAndStop (1);
on (rollOver) {
this.gotoAndPlay("links");
tellTarget (_root.navigation.introduction) {
gotoAndStop (1);
tellTarget (_root.navigation.overview) {
gotoAndStop (16);
tellTarget (_root.navigation.coronary) {
gotoAndStop (1);
this code is ok, it seems that when u rollover on the button,
the event is fired and it keeps on running the time u r on it. i
think just add
delete this.onRollOver inside rollOver event.
Similar Messages
-
Event Handlers for Dynamic Buttons
Hi, I hope someone can help. I just can't figure out how to
solve this problem:
I am creating an number of buttons dynamically that
correspond each to a filename read from a directory. The problem is
I don't know ahead of time how many buttons (files) I will have so
I create them dynamically in action script. -- this much I can do.
What I can't figure out is how do I assign each of these
dynamically created buttons individually specific event handlers?
ie. I need to know which file icon you clicked on and then take
action based on that info.
for example: "folder" is a button icon I have linked from my
library - i name each instance "folder"+i -- what I need to do is
do something for folder1, folder2 etc.
for (i=1;i<numdirs;i++) {
graphics.attachMovie("folder","folder"+i,depth);
graphics["folder"+i]._y= coordy2;
// want to put an event handler here for each
graphics["folder"+i] button
I wanted to do something like:
graphics["folder"+i].onRelease = function() {
test_txt.text = i;
but each button I click on gives me i= numdirs (ie the max
number -- for example 6 if there are 6 files, I can't identify
which button you actually clicked on -- button1 through 6 all
deliver the number 6 to test_txt.text)
I hope that makes sense - if someone can take a swag at this
and point me in the right direction I will be very appreciative.
Best Regards,
TomThere is other way to do that.. whenever you call a
attachMovie or loadMovie
function there is a return value that corresponds to the
actual movieclip
created on the flash movie. ie
for (i=1;i<numdirs;i++) {
var temp_mc:MovieClip =
graphics.attachMovie("folder","folder"+i,depth);
that new reference temp_mc is the newly created movieclip and
you can do
whatever you want with it, ie:
for (i=1;i<numdirs;i++) {
var temp_mc:MovieClip =
graphics.attachMovie("folder","folder"+i,depth);
temp_mc._y = 30
temp_mc.id = I
//even assign new funtions to events
temp_mc.onRelease = releaseFunction
function releaseFunction(){
trace("do something on the release event")
<DIV>"charmcityMD"
<[email protected]> wrote in
message
news:ed2l97$n8$[email protected]..</DIV>> THANK YOU
soo
much -- I have been pondering this and scanning the web for
hours. Your
solution is perfect. I very very much appreciate your help.
>
> Best Regards,
> Tom -
Multiple click points for one button and movie clip
I am trying to make a single button into a multiple click
point. I have a movie clip on the stage and I have an invisible
button over it. The movie clip consists of a single timeline that
has an ambient animation running and looping intially. I have three
more labeled sections of that timeline that each contain a
different animated sequence as click point animations for that
movie clip. I want the user to click on the button on the stage and
the first labeled click point animation of that movie clip will
play. I want that action to be stored so that when the user clicks
again then the second labeled click point animation will play then
they will click for the third in the same way. In between user
clicks I want the ambient animation loop in the beginning of that
movie clip timeline to play. When the user has clicked the 3rd and
last animated sequence then the whole thing will reset and be
available again. Can anyone let me know how that can be
accomplished. I originally scripted it through tell target to play
the first but I don't know how to move forward. Thanks!What version of Flash are you using? Telltarget is very
old... try something like this:
// array of the animations
myAnims = ['firstAnim','secondAnim','thirdAnim']; // these
are also frame labels
// your current animation index in the array, arrays start at
0,
// so we start at -1 which is like before anything
currAnim = -1;
// function to play the next animation
function nextAnim(){
// add one to the current animation index
currAnim++;
// if you've reached the end of the array, start back at 0
if(currAnim >= myAnims.length)currAnim = 0;
// now tell the MovieClip to play based on the value of the
current array index
myMovieClip.gotoAndPlay(myAnims[currAnim]);
Then on the button you just put:
on(release){
nextAnim();
And at the end of each animation on the timeline, put:
gotoAndPlay(1);
And at the end of the ambient loop at the beginning I guess
you have that, too, so it loops.
Hope that helps -
Hi,
I want perform some validations when I press back button.how to find event handlers for back button,because F2
is not giving full info for back button.
Regards,
BrahmajiHi,
the back button is always part of toolbar buttons.
So you can open the view controller class and open the GET_TOOLBAR_BUTTONS method from that class.
In this method you see how the BACK button is defined. One of the attribute of button structure is ON_CLICK.
The value of this attribute should be the event name that is triggered when the button is clicked.
Now open the DO_HANDLE_EVENT method from the view controller class, you will have methods with prefix EH_ON
after the prefix you see the event name. If you find one that mached to the event name of the BACK button, then this is the event handler that is triggered by the BACK button.
Regards,
Steve -
Multiple menu items != multiple event handlers?
I'm developing a program whereby a user can rate how much they like certain images when displayed on screen. The bulk of the work is done, but my rating mechanism (first attempt at one) is currently a right-click pop-up menu with the values 1-10 in ten menu items - naff I know, but its early design stages ;)
This brings obvious problems, and I don't want to have to code event handlers for each and every Menu item just to set the same parameter to a different value depending on which menu item the user clicked (i.e. I don't want to have to create an event for the first menu item that simply sets and int variable to 1, and do the same for #2 through 10). What I was wondering was, is there any simpler way of implementing this? I.e. can I use the same event for the whole popup menu and detect the value of the option clicked and set the value accordingly? This would also mean, should I need to extend the rating scale above ten, say perhaps to twenty, then there would be no further coding necessary (which is nice! Lol!).
Can anyone offer any suggestions? I did search, but tbh didn't have a clue what to search for. Your advice is appreciated.Implement the ActionListner that allows the constructor to take an argument as to the rating of the menu item, and then set the required rating variable to this when called. For example
class MyRatingSystem
int rating = 0;
public void createMenus()
JMenu ratings = new JMenu("Ratings");
for(int i = 0; i < 10; i++)
JMenuItem rating = new JMenuItem("Vote: " + i);
rating.addActionListener(new RatingListener(i));
ratings.add(rating);
class RatingListener imlpements ActionListener{
final int rate;
public RatingListener(int rate)
this.rate = rate;
public void actionPerformed(ActionEvent ae)
rating = this.rate;
}The above code is inefficient and is only there to serve the purpose of an example(look at the loop, although I would think the compiler could do some loop unrolling?)
HTH -
How to remove event handlers for a content type currently in use?
Hi,
We had a SP 2007 solution that managed event handlers as described in
Brian Wilson's blog regarding event handlers. We then did a in-place upgrade to SP 2010. It so happend that we wanted to remove some of our old event handlers and this is where our problem started. We managed to delete event handlers
(SPEventReceiverDefinitions) for
Site and List by using the ui from Brian Wilsons feature "Manage Event Handlers" (ref the link above), but not anyone at all for
Content Types... It simply wouldn't be deleted
(remove was grayed out in the ui).
We then tried to do it by code. Below is a code snippet illustrating how we tried to delete the event handlers for content types:
using (SPWeb web = properties.Feature.Parent as SPWeb)
string targetClassName = "targetClassName.";
web.AllowUnsafeUpdates = true;
// Removing Content Type event handlers
foreach (SPContentType ct in web.ContentTypes)
for (int i = ct.EventReceivers.Count - 1; i >= 0; i--)
if (ct.EventReceivers[i].Class.StartsWith(targetClassName))
ct.EventReceivers[i].Delete();
ct.Update(true);
web.Update();
The Content Types are not sealed and are
not readonly. When debugging, we can see that the
Delete() method are called on one of the Content Types we wanted to delete event handlers for. We noted that the
ct.EventReceivers.Count remains the same, before and after Delete() is called. We did not get any exceptions when running this code.
When running the code a second time and debugging again, we see that the very same Content Type still has the very same event handler attached... As in, it wasn't deleted....
We also tried to delete the event handlers through PowerShell as described
here in the post by Per Jakobsen. However, the script did not really seem to find any EventReceivers... We tried to write the
$site.AllWebs | % {$_.Lists} | % {$_.ContentTypes} | % {$_.EventReceivers} list to file, but it was empty.. We did however get a long list when writing $site.AllWebs | % {$_.Lists} | % {$_.ContentTypes} to file. We could then in
that file see the event handler references we want to remove registered to our Content Types, as we did during code debugging earlier on. So PowerShell might still be the way to go here...
So, does anyone know if there is a way to force this delete through, either by code, PowerShell or some other means? Any help regarding this matter would be very much appreciated :)Hi,
For your information, there's two versions (at least) exists for each content types. One is Site Content Type - exists in Root web and another is list content type. Once you add a content type to a list, a copy of the site content type is taken and stored
in the list. If you update the site content type, it may or may not affect the list conten type. So make sure you are updating the both - site content and list content type. Once you update site content type with passing paramater true to 'ct.Update(true)',
the list content types are supposed to updated too.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
Multiple free goods for one item in standalone CRM
Hi Gurus,
We are trying to implement multiple free goods for one item in standalone CRM.
As per SAP.help.com, it says that we can configure multiple free goods scenario in standalone CRM system.
We tried to set up this in our system. Basically we want to implement the scenario, where a user wants to purchase item A, he should get a prompt for choosing between two free goods B and C.
We did the relevant IMG settings required for Free goods at IMG ->CRM -> Basic Functions -> Free Goods.-> Set up Free Goods
We also did the relevant item category determination where we have made an entry with
Item Usage = " Free Goods" , Main item cat. = "TAN' , Item Category = "TANN".
Now we went to create condition records in the path "SAP Menu -> Master Data -> Prices and Conditions -> SAPCND/GCM - Maintain condition"
We chose Application ="PRT", MaintenanceGrp="PRT_FGOODS", Maintenance context ="GCM"
Then while creating conditon records , when I try to create two condition records where the Main Product is same but free good product is different, the system is not allowing to save these two condition records.
it is giving error "Overlapping validity periods for two condition records".
Please advice, if i am missing something. Thanks in advance for your help.
thanks,
Randhir
Edited by: Randhir Soni on Feb 8, 2010 8:12 AMConstraints in free goods in R3 taken from SAP library
Free goods can only be supported on a 1:1 ratio. This means that an order item can lead to a free goods item. Agreements in the following form are not supported: u2018With material 1, material 2 and material 3 are free of chargeu2018 or u2018If material 1 and material 2 are ordered at the same time, then material 3 is free of chargeu2018.
Free goods are not supported in combinations with material structures (for example, product selection, BOM, variants with BOM explosion).
Free goods are only supported for sales orders with document category C (for example, not quotations).
Free goods are not supported for deliveries without reference to a sales order.
Free goods cannot be used in make-to-order production, third-party order processing and scheduling agreements.
If you defined a free goods for variants in a generic article (only SAP Retail), you can only process the variants in the purchase order and goods receipt individually (as single articles). In other words, you cannot process them using the generic article matrix.
This answers your qn Not possible in R3
If you are on Retail scenario this is possible thro bonus buy schemes
But a lot of customizations needs to be done and you need a retail server to do that
Regards
Raja -
Multiple free goods for one main material
Hello SAP Gurus,
we have a business requirement that to issue multiple free products for one main product, if the upliftment is beyond the specified quantity.
Using free goods functionality, is it possible to achive the above requirement.
e.g Quantity
main product 123456 10
free goods xxxxx 2
free goods yyyyy 1
is it possible to maintain such data thru free goods or any development needs to be done.
regards
CasimerConstraints in free goods in R3 taken from SAP library
Free goods can only be supported on a 1:1 ratio. This means that an order item can lead to a free goods item. Agreements in the following form are not supported: u2018With material 1, material 2 and material 3 are free of chargeu2018 or u2018If material 1 and material 2 are ordered at the same time, then material 3 is free of chargeu2018.
Free goods are not supported in combinations with material structures (for example, product selection, BOM, variants with BOM explosion).
Free goods are only supported for sales orders with document category C (for example, not quotations).
Free goods are not supported for deliveries without reference to a sales order.
Free goods cannot be used in make-to-order production, third-party order processing and scheduling agreements.
If you defined a free goods for variants in a generic article (only SAP Retail), you can only process the variants in the purchase order and goods receipt individually (as single articles). In other words, you cannot process them using the generic article matrix.
This answers your qn Not possible in R3
If you are on Retail scenario this is possible thro bonus buy schemes
But a lot of customizations needs to be done and you need a retail server to do that
Regards
Raja -
Creation of multiple cost center for one emplyee
HI All,
I have requirement . one emplyee is working two projects so need create two cost centers for one employee.
please tell me how create multiple cost center for one employee.
Thanks&Regards
rameshhai.
if he works half the time... u can give 50%.. or just get it confirmed from core team member..
manu -
Show or view multiple album art for one song on iPhone 4?
Is it possible to show or view multiple album artwork for one song on an iPhone 4, especially on the now playing screen? I figured since iTunes has this feature then the iPhone should too. Can I download an app that does this? I've searched but couldn't find any, maybe I'm using other keywords. Could anyone point me in the right direction with this?
Darn. I hope an app is designed to be able to do this soon. From what I've seen this feature isn't really in demand so it could take a while. Thanks for replying.
-
Multiple Lease Duration for one DHCP Scope?
Hi All,
I have an urgent question. I wanted to know if it is possible to have many lease durations for different computer groups getting their addresses from one DHCP scope. I saw somewhere that it is possible to use User Classs or Vendor Classes for setting a lease
duration for a group of computers sharing the same class Id ?
If it is true, How can to configure ?
Also i would like to know about the lease duration period what is the maximum days can we have ( 8 days After )?
Thanks
AtulPlease refer to the following-
http://social.technet.microsoft.com/Forums/windowsserver/en-US/26de79f9-6ad7-4088-9077-006b9dd8c1fb/multiple-lease-durations-for-one-dhcp-scope?forum=winserveripamdhcpdns
You can configure any value as lease duration; however if you want a very big/infinite value; it makes sense to convert the lease(s) to a reservation. -
Multiple component instances for one component usage
Hi,all
How can I create multiple component instances for one component usage.
I'm using the following code for creating a single component instance for specific component usage:
if(c_Usage.hasActiveComponent())
c_Usage.deleteComponent();
if(wdContext.currentContextElement().getSelectedTab().equalsIgnoreCase("Registered"))
c_Usage.createComponent("health.gov.registered.Registered";);
I can't create one more component instance for
IWDComponentUsage c_Usage
cause I have to delete the component instance associated with this component usage.
Any idea how can I do it anyway?
Regards,
MichaelHi,
To create another instance of the same component you need to embed the same component under the Used Components more then once. For Example if you have Componet A to which you want to embed Component B then under "Used Components" of Component A add component B twice. -
Multiple db connections for one report
Hi all,
I am using Oracle Reports 10g R2. Could someone tell me if Oracle Reports supports multiple database connections for one rdf file, like this (using servlet)
http://your_web_server:port_num/reports/rwservlet?server=server_name&report=myreport.rdf& userid1=username/password@my_db1&userid2=username/password@my_db2 &desformat=pdf&destype=cache
I am asking this question because my report needs data from two separate Oracle databases.
Edited by: user12239004 on Apr 27, 2010 2:14 AMNo, you can only have one login.
However, this is simple to resolve by creating a database link in one database to the other database. -
How to find event handler for save button in salesorders
Hi,
I want perform event based on save button in salesorders.Can you tell me how to find the event handler for
save button.
Regards,
BrahmajiBrahma,
you can find the component, view details by doing an F2.
open the component, the view will be mostly an overview page i.e., the name ends OP etc.,
But your method name will be mostly EH_ONSAVE, you need to find exact view.
F2 does not come up properly for overview pages, you have to look into UI config tool preview and make sure sometimes.
Regards,
Masood Imrani S. -
Multiple event handlers registered for the same event and error when adding users to sec groups
Project Server 2013 CU April (May) 2014
I've created and installed two event handlers (separate dll:s) and both are triggering on Project Published - initially, both are working fine.
After an IISReset, trying to create a new security group (or add a user to an existing group) will result in an error on the page and a corresponding error in the ULS log - the latter indicating an error in the method security.creategroups, and specifically
a problem 'An item with the same key has already been added.'
An SQL trace reveals a break in execution after executing the proc 'pub.MSP_ADMIN_ReadEventReceivers' which returns all registered event handlers.
In my case, the result of that proc execution shows that there are two event handlers registered with an EVENT_ID of 53 (Project Published) and with ORDER_FIRED set to 1 and 2 respectively.
I tried removing one of the event receivers using the Central Admin PWA interface and then everything worked just fine - I added the event receiver back again, and everything STILL worked! IISReset and I got the error back again. :-(
Since there's obviously some problem with reading multiple entries from that table regardless of the ORDER_FIRED differentiation, I tried temporarily modifying one of the '53' entries in the table directly and then the sec group was created just fine!
I would like to know if anyone else has seen this? I've seen this on three separate installations now after deploying a second event listener onto those systems.
/Lars Hammarberg
//Lars Hammarberg www.connecta.seHi Lars,
yes I have seen the same issue. It is not related to April CU. I had the error before with SP1.
It is not only an issue with the security groups. At least in our case nothing worked at all. No custom field editing, all Queue Jobs failing.
For your case I suggest you consolidate your code in one eventhandler.
Theory says that you can have more than 1 (up to 999) eventhandlers for one Event (http://msdn.microsoft.com/en-us/library/ms481079(v=office.12).aspx) but that seems not to
work. Not sure, if it worked in earlier versions.
Kind regards
Christoph
Christoph Muelder | Senior Consultant, MCTS, MCSE, MCT | SOLVIN information management GmbH, Germany
Maybe you are looking for
-
Dear I-pod users, I haven't used my i-pod in a long time and I forgot the password It was disabled after countless tries but right now is not disabled.Is there any way I can delete the password on the computar instead of going to the Apple store
-
Vendor Evaluation - SAP Standard questionnaire always displays in German
Hi, All settings to pop up the event driven questionnaire are in place for event Confirmation. System is SRM 7 EHP2. I can confirm in the survey cockpit BBP_EVAL_SURVEY that: 1) Questionnaire SRM_CONF1E is for English 2) Questionnaire SRM_CONF_1 is f
-
Howto disable Enterprise Edition features per schema
We develop software that uses Oracle 11gR2 as the back end. In all of our internal development environments, we use Enterprise Edition, with all the packs, which we are licensed for, which gives us the ability to test various EE features that may/ma
-
HI, all of our enterprise switches are sert to send syslog messages from facility local3. this is partly because our linux syslog server loggs its boot syslog messages from facility local7 an we could't use the default facility
-
how can we use Lync 2010 in Linux machines..? do we have any third party applications which can support Voice and Video.? Kris