In message <11************ **********@f14g 2000cwb.googleg roups.com>,
trint <tr***********@ gmail.com> writes
Ok,
I have created a flash animated button that I want to use as a regular
button in my c# web app.
Using actionscript, do you know how to call the c# functions in the
project?
I'm not sure you want or need to do that, if you want to use it as a
regular button. All you need to do is to make clicking on the button
generate a server-side event via a postback.
Subclass Panel and implement IPostBackEventH andler.
Add a Click event:
public event ImageClickEvent Handler Click;
In CreateChildCont rols, create a literal containing the HTML to display
your Flash object and add it to controls.
When creating the HTML, use
this.Page.GetPo stBackClientEve nt(this,"")
to get the text of a javascript function to cause a postback to the
control and make it the target of the onclick event either of the
<embed> tag or of an <a> tag surrounding the <embed> tag.
eg.
string html = "<embed onclick=\"" +
this.Page.GetPo stBackClientEve nt(this,"") +
"\" type=\"applicat ion/x-shockwave-flash\"" +
".....</embed>";
etc.
I can't remember whether onclick works for <embed> in all or indeed any
browsers, try <a> also. I got some combination of these to work.
Raise the Click event in the RaisePostBackEv ent method:
public void RaisePostBackEv ent(string eventArgument)
{
if(this.Click !=null)
{
this.Click(this ,new ImageClickEvent Args(0,0));
}
}
You then have a button with a server-side click event which renders as a
flash movie.
--
Steve Walker