Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
baEc #1
Q: how to create custom events
ok ive been all through the manual again trying to figure this out but i
just cant find it.
how can i generate my own custom event ?
for example : movie clip A moves to the left and when it gets to the left
border of the screen i want it to trigger an event call
I-Got-To-The-Left-Most-Side-Of-The-Screen [or - IGTTLMSOTS ;)].
thx for any help on this
baEc Guest
-
Custom Events in Web Services
Hello, I have created a class with custom events. The delegate for the event is created before the class is declared. This event works fine when... -
Bubbling up custom events in datagrid
I have a custom web control GridList which contains an array of derived Datagrid controls. Each datagrid has an additional event OnRowSelect, fired... -
how to add events to a custom control
"TIBM" <TIBM@discussions.microsoft.com> wrote in message news:15A29094-90DA-4E14-80B5-A433BE45136F@microsoft.com...... -
Events in Custom Controls and Sub Classes
Hello i try do this. Class DemoBase Public Delegate Sub DemoItemEventHandler(ByVal sender As Object, ByVal e _ As DemoItemEventArgs) Public... -
Custom Server Control Events
This a newbie question but I would like to build a custom server control which updates a database. While I have got as far as writing in HTML via... -
Uritsukidoji #2
Re: Q: how to create custom events
Flash MX 2004 documentation:
Did you see these pages?:
Creating events:
[url]http://livedocs.macromedia.com/flash/mx2004/main/05_cre34.htm[/url]
Dispatching events:
[url]http://livedocs.macromedia.com/flash/mx2004/main/05_cre44.htm[/url]
Handling events:
[url]http://livedocs.macromedia.com/flash/mx2004/main/05_cre41.htm[/url]
Assuming you already have you custom class, make you class match this:
import mx.events.UIEvent;
import mx.core.UIObject;
[Event("IGTTLMSOTS")]
class myClass extends UIObject {
.... // other declarations
function reachLeft(){
dispatchEvent ({type:"IGTTLMSOTS", arg1, arg2 });
}
.... // other declarations
}
good luck
baEc wrote:
> ok ive been all through the manual again trying to figure this out but i
> just cant find it.
> how can i generate my own custom event ?
> for example : movie clip A moves to the left and when it gets to the left
> border of the screen i want it to trigger an event call
> I-Got-To-The-Left-Most-Side-Of-The-Screen [or - IGTTLMSOTS ;)].
> thx for any help on this
>
>Uritsukidoji Guest
-
baEc #3
Re: Q: how to create custom events
hey Uritsukidoji, thx for your help. i dont know much about component
creation. i was trying to avoid that subject but maybe i will have to go
into it after all. is extending UIObject the only way i can define my own
events ? i think in flash mx [not 2004] you could do something like this -
Counter = function(max){
this.max = max;
this.value = 0;
}
Counter.prototype.increment = function(){
++this.value;
if (this.counter == this.max){
this.onMax(); // here's the new event call
this.counter = 0;
}
}
i got this example somewhere but im not really sure where anymore and
whether it still would work with the new flash ??
baEc Guest



Reply With Quote

