Re: [flashcoders] Q: binary data (JPG) in XML

2007-05-24 Thread Mischa Williamson
If you base64 encode the jpeg contents then it should be safe to put  
in a CDATA node and send over the wire.


Cheers,

Mischa

On 23 May 2007, at 21:25, eric e. dolecki wrote:

I have been asked if its possible to have Flash display a JPG thats  
stored
in XML as a binary object (ie. I don't get a path to the JPG, I get  
the
JPG). I have NO idea what this XML looks like yet, but perhaps  
someone has

done this already?

I am not very good with BitmapData, etc. yet and unsure if one needs
ByteArray stuff or not.

Any insight would be good ;)

- Eric
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Good External Actionscript Editor for Mac?

2006-12-13 Thread Mischa Williamson
Xcode works well for me. Although SCM support is a little flaky and  
I've ended up using svnX for SCM.


Cheers,

Mischa

On 13 Dec 2006, at 20:07, Steven Sacks | BLITZ wrote:


I'm not a fan of Eclipse.  I don't like that Flex Builder is based on
Eclipse, but I can't seem to get the ANT compiler working with Flash
Develop, so I'm stuck using the Flash IDE or Flex Builder 2 for my AS3
projects for now.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] AS 3: URLLoader Firefox IO Error Trigger Issue

2006-10-22 Thread Mischa Williamson

I'm wondering if anyone can replicate or has experienced this issue.
When using URLLoader and playing back in Firefox 1.0.7/Camino 1.0 on
OS X (10.4.7) with Flash player 9,0,15,0 the IOErrorEvent.IO_ERROR
does not fire.

When I test in Safari the event triggers fine. Is this a known issue?
I couldn't find anything searching the list. I haven't had the chance
to test on Windows.

These results can be verified by compiling and testing the example here:

http://livedocs.macromedia.com/flex/2/langref/flash/net/URLLoader.html

I'm using mm.cfg and a "tail -f flashLog.txt" to test the behaviour in
the browser.

Can anyone from Adobe comment on this? If anyone could test this on a
Windows machine with Firefox/IE etc and the same Flash player version
it would be appreciated.

Cheers,

Mischa
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Which object called the function

2006-10-07 Thread Mischa Williamson

arguments.caller

Will give you a reference to the calling function. From the help:

Property; refers to the calling function. The value of this property  
is null if the current function was not called by another function.


Cheers,

Mischa

On 7 Oct 2006, at 17:02, Dr. Suhas Pharkute wrote:

Initialise objects with unique ID's which will help you later to  
determine

which object is calling the function.

Suhas

On 10/7/06, Ramon Miguel M. Tayag <[EMAIL PROTECTED]> wrote:


Hi everyone,

How do you find out which object calls a particular function?  Is it
even possible?

Let's say there are two classes:

class A
{
function A(){}

function hello()
{
trace ("hello");
//I want to know who called me, here
}
}

class Main
{
var a = new A();

function Main()
{
a.hello();
}
}

=

How will A know that Main called the function?

Thank you,
--
Ramon Miguel M. Tayag
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
Dr. Suhas Pharkute, PhD
Syna Intelligence, LLP
V. 208 830 8915 (C)
E. [EMAIL PROTECTED],.com
W. http://synaintel.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] parsing full instance pathname? or am I completely wrong strategy?

2006-09-11 Thread Mischa Williamson

How about:

function click(eventObject:Object) {
trace( eventObject.target._name );
trace( eventObject.target._parent._name );
}

?

But if you are doing different actions for each button it is  
preferable to use a Delegate and create separate function handlers as  
it make the code much easier to understand and maintain and prevents  
needless string comparison.


On 12 Sep 2006, at 00:01, James wrote:


function click(eventObject:Object) {
// decide what to do
}


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] That yellow focus rectangle

2006-05-22 Thread Mischa Williamson

_focusrect = false;

Should do it.

On 5/22/06, Manuel Saint-Victor <[EMAIL PROTECTED]> wrote:


I'm looking for relief from the yellow focus rectangle that happens to
movie
clips when they gain focus in my app.
I came across this discussion from
2004<
http://weblogs.macromedia.com/accessibility/archives/2004/08/simple_text_nav.cfm
>(see
simple focus)  but am curious if there is now a standard way of
approaching
this.

Thanks,
Mani
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] AS IDE for OSX

2006-03-16 Thread Mischa Williamson
Thanks for the heads-up on the free SDK Darron, oh, and your informative
posts about AS3 ;)

Now just got to port my AS3 code base from alpha to beta *sigh*

Incidentally, anyone had any problems with the Math parser in AS3? I ran
into some wierd issues porting Robert Penner's easing equations in the alpha
version of the compiler. I'll post code examples if anyone's interested...

On 3/16/06, Darron J. Schall <[EMAIL PROTECTED]> wrote:
>
> eric dolecki wrote:
> > Isn't MTASC going to die on the vine when AS3 enters the scene?
> >
> > :(
>
> There's going to a be free Flex 2 SDK that includes the Flex framework
> and compiler, so you can use mxmlc without having to purchase
> FlexBuilder.  There won't be a need for MTASC anymore (mxmlc, despite
> the name, is an AS3 compiler as well).
>
> -d
>
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] AS IDE for OSX

2006-03-16 Thread Mischa Williamson
I think it'll stop being used when Flash Player 7/8 die out - until then
it's still a valuable tool. That's one of the great things about XCode it
plays nice with the AS3 alpha/betas:

http://www.joshbuhler.com/2005/10/20/compile-as-3-on-mac/

Thanks Josh :)

That's why I think XCode is the best all round solution, it's so flexible.
And even when it falls short you can work around it. For example, checking
out a project from CVS and automatically importing it into your XCode
project doesn't seem to be possible. But with a combination of Applescript
and shell scripts it works like a charm.

Cheers,

Mischa

On 3/16/06, eric dolecki <[EMAIL PROTECTED]> wrote:
>
> Isn't MTASC going to die on the vine when AS3 enters the scene?
>
> :(
>
> On 3/16/06, Mischa Williamson <[EMAIL PROTECTED]> wrote:
> >
> > I think XCode is the best solution, I've tried SubEthaEdit, TextMate,
> > Smultron and Eclipse and they all fall short.
> >
> > XCode with CVS or SVN is great for versioning (compared to Eclipse),
> > and along with MTASC for compilation plus a custom executable (shell
> > script) takes it to a whole new level. I can set up a shell script to
> > launch a page running on my local web server or set it up to FTP all
> > the relevant files and then launch a browser to the remote URI.
> >
> > I haven't got this far yet, but i think in combination with an ANT
> > task for deployment this is a great solution. It has certainly made
> > my workflow far more efficient.
> >
> > Damn, I love MTASC! Thanks Nicolas :)
> >
> > Cheers,
> >
> > Mischa
> >
> > On 16 Mar 2006, at 20:16, Alisdair Mills wrote:
> >
> > > have switched between most AS editor options for the mac at one
> > > point or another (including Xcode, SubEthaEdit, BBEdit, TextMate,
> > > Smultron... even tried Emacs). Since using FDT with Eclipse though
> > > I can't imagine ever using anything else until maybe Zorn makes
> > > a fully supported Mac appearance that is.
> > >
> > > cheers, Al
> > >
> > >
> > > On 16 Mar 2006, at 19:10, Nik Derewianka wrote:
> > >
> > >> Hey all,
> > >>
> > >> Title pretty much says it - what are peoples using for an AS IDE
> > >> on the mac
> > >> ?  Flash itself is actually worse than director in this regard,
> > >> SEPY is
> > >> great on PC, cant even do copy and paste on a mac and last build
> > >> seems
> > >> broken, ive seen some blog posts regarding AS integration into
> > >> Xcode but
> > >> they are all over a year old.
> > >>
> > >> I dont want a text editor (i already have and love TextMate) but
> > >> an IDE that
> > >> can organise all my files, syntax highlighting, code completion,
> > >> jump to
> > >> handler definitions and compilation, version control integration
> > >> would be a
> > >> bonus (pref svn).
> > >>
> > >> Does such a beast exist ?
> > >>
> > >> Regards,
> > >> --
> > >> :: Nik Derewianka ::
> > >> ___
> > >> Flashcoders@chattyfig.figleaf.com
> > >> To change your subscription options or search the archive:
> > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >>
> > >> Brought to you by Fig Leaf Software
> > >> Premier Authorized Adobe Consulting and Training
> > >> http://www.figleaf.com
> > >> http://training.figleaf.com
> > >
> > > ___
> > > Flashcoders@chattyfig.figleaf.com
> > > To change your subscription options or search the archive:
> > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >
> > > Brought to you by Fig Leaf Software
> > > Premier Authorized Adobe Consulting and Training
> > > http://www.figleaf.com
> > > http://training.figleaf.com
> >
> > ___
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] AS IDE for OSX

2006-03-16 Thread Mischa Williamson
I think XCode is the best solution, I've tried SubEthaEdit, TextMate,  
Smultron and Eclipse and they all fall short.


XCode with CVS or SVN is great for versioning (compared to Eclipse),  
and along with MTASC for compilation plus a custom executable (shell  
script) takes it to a whole new level. I can set up a shell script to  
launch a page running on my local web server or set it up to FTP all  
the relevant files and then launch a browser to the remote URI.


I haven't got this far yet, but i think in combination with an ANT  
task for deployment this is a great solution. It has certainly made  
my workflow far more efficient.


Damn, I love MTASC! Thanks Nicolas :)

Cheers,

Mischa

On 16 Mar 2006, at 20:16, Alisdair Mills wrote:

have switched between most AS editor options for the mac at one  
point or another (including Xcode, SubEthaEdit, BBEdit, TextMate,  
Smultron... even tried Emacs). Since using FDT with Eclipse though  
I can't imagine ever using anything else until maybe Zorn makes  
a fully supported Mac appearance that is.


cheers, Al


On 16 Mar 2006, at 19:10, Nik Derewianka wrote:


Hey all,

Title pretty much says it - what are peoples using for an AS IDE  
on the mac
?  Flash itself is actually worse than director in this regard,  
SEPY is
great on PC, cant even do copy and paste on a mac and last build  
seems
broken, ive seen some blog posts regarding AS integration into  
Xcode but

they are all over a year old.

I dont want a text editor (i already have and love TextMate) but  
an IDE that
can organise all my files, syntax highlighting, code completion,  
jump to
handler definitions and compilation, version control integration  
would be a

bonus (pref svn).

Does such a beast exist ?

Regards,
--
:: Nik Derewianka ::
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Re:AS3 reference live docs missing?

2006-01-31 Thread Mischa Williamson
Same deal here Tom. I really need that documentation available.

Can anybody from Adobe comment on this issue please?

Cheers,

Mischa

On 1/30/06, Tom Bray <[EMAIL PROTECTED]> wrote:
> Is there a mirror for this somewhere?  I was depending on this for a
> proof-of-concept I'm working on.
>
> Broken link:
> http://livedocs.macromedia.com/labs/1/flex/langref/index.html
>
> On 1/27/06, M S <[EMAIL PROTECTED]> wrote:
> > Let's hope they are filling in all the HOELS! :) Many things in the
> > interfaces that would be great to start reading.
> >
> > Sorry, a bit more detal
> >
> > www.macromedia.com/go/programmingAS3 This is a help book
> >
> > http://livedocs.macromedia.com/labs/1/flex/langref/ This is the language
> > reference API book.
> >
> > Peace, Mike
> >
> > On 1/27/06, M S <[EMAIL PROTECTED]> wrote:
> > >
> > > No, that is not the API book.  I get the same page dead link to.
> > >
> > > On 1/27/06, Greg Hamer <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Weird.  This redirect link still works:
> > > > www.macromedia.com/go/programmingAS3
> > > > ___
> > > > Flashcoders mailing list
> > > > Flashcoders@chattyfig.figleaf.com
> > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > > >
> > >
> > >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Dynamic class creation

2006-01-30 Thread Mischa Williamson
I've done exactly that using eval() before. Give it a try.

Cheers,

Mischa

On 1/30/06, franto <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> maybe it is easy, maybe not, but i cant figure it out now, and i need it :)
>
> when i got class e,gpkg1.pkg2.pkg3.className
>
> i can make new instance in this way
> new pkg1.pkg2.pkg3.className()
>
> but i want to make it from string
>
> this dont work of course
> _global['pkg1.pkg2.pkg3.className']();
>
> but this work:
> _global['pkg1']['pkg2']['pkg3']['className']();
>
> can this done automatcally? i want jsut read string from XML and
> create new class instance,
> but i cant do it now.
> Any help is appreciated :)
>
> -
> Franto
>
> http://blog.franto.com
> http://www.flashcoders.sk
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Q: html and flash

2005-12-01 Thread Mischa Williamson
You can use the SharedObject (Flash's version of cookies) to store the
current state of the menu (before changing the URL) and then recreate that
state within Flash on each subsequent page refresh.

Check out SharedObject in the AS dictionary.

Mischa

On 12/1/05, Corban Baxter <[EMAIL PROTECTED]> wrote:
>
> Hey all I am working on an html/flash hybrid site. We are creating the
> menu in flash that has expandable and collapsible sections for that
> encompass the larger sections. What we would like to do is when a section is
> expanded and a sub link is clicked the user will obviously go to the next
> page. But we would like to some how tell flash that the user is in a certain
> sub section and to keep that part of the menu expanded when the page reloads
> without using frames...
>
> I am sure there is a simple way to pass a variable to flash when you are
> at a specific page I am just not sure how to go about doing this. I
> understand how to tell the menu where to be when its loaded but how do I get
> a variable passed to the menu from html/javascript so that I can use the
> variable in flash? I hope this makes sense. Thanks!
>
> Corban Baxter |rich media designer |www.funimation.com
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Autopopulating from a webservice

2005-11-04 Thread Mischa Williamson
You are right it is to do with the EventDispatcher. If i put this line into
MM's addEventListener method:

trace( "add event : " + this[queueName] )

The output is:

add event : [type Function]

When clearly it should be an array. I think it has something to do with the
WSProxy class being dynamic. I haven't got time to debug it properly, but i
have uploaded my EventDispatcher class:

http://freeform-systems.com/share/actionscript/EventDispatcher.as

Which definetely works with the WSProxy class and the code you posted.

Hope this helps.

cheers -- mischa

On 11/4/05, Jeroen Janssen <[EMAIL PROTECTED]> wrote:
>
> Thanks for helping me out!
>
> I tried the code you posted but I still get the same result.
>
> It seems that onresult fires a resultHandler method and not the
> listeningObject.result method.
>
> This is what I see if I uncomment your trace commands:
> f : doCompanyInfo
> Method doCompanyInfo was called with arguments: any,any,macr
> Web service result : [object Object]
> f : resultHandler
> Method resultHandler was called with arguments: [object Object]
>
> Is it due to the eventdispatcher class you are using?
>
> Grtz,
> Jeroen
>
>
> -Original Message-
> From: Mischa Williamson [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 4 november 2005 11:45
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Autopopulating from a webservice
>
> You need to access the "result" property of "eventObj". This works well
> for
> me:
>
> import com.ffsys.util.WSProxy;
>
> var listeningObj:Object = new Object();
>
> listeningObj.result = function(eventObj:Object):Void {
> trace("###");
> trace( "company : " + eventObj.result.company );
>
> for( var z in eventObj.result )
> {
> trace( z + " || " + eventObj.result[ z ] )
> }
> }
>
> var ws:WSProxy = new WSProxy( "
> http://www.flash-db.com/services/ws/companyInfo.wsdl"; );
>
> ws.addEventListener( "result", listeningObj );
> ws.doCompanyInfo("any","any","macr");
>
> Hope it helps.
>
> cheers -- mischa
>
> On 11/3/05, Jeroen Janssen <[EMAIL PROTECTED]> wrote:
> >
> > Still not getting it :(
> >
> > I'm using this code with the class Mischa provided but it doesn't
> work.
> > Beware, this is my first time working with listeners so I could do
> > something incredibly stupid ;)
> >
> > var listeningObj:Object = new Object();
> >
> > listeningObj.result = function(eventObj:Object):Void {
> > trace("###");
> > trace( eventObj.company );
> > }
> >
> > var ws:wsproxy = new wsproxy(
> > "http://www.flash-db.com/services/ws/companyInfo.wsdl"; );
> >
> > ws.addEventListener( "result", listeningObj );
> > ws.doCompanyInfo("any","any","macr");
> >
> > I already used different methods for the listeningobj but none of them
> > seem to work.
> >
> > Please help :)
> >
> > Jeroen
> >
> >
> >
> > -Original Message-
> > From: NEILHIGHLEY.COM <http://NEILHIGHLEY.COM> <http://NEILHIGHLEY.COM>
> [mailto:
> > [EMAIL PROTECTED]
> > Sent: woensdag 2 november 2005 19:59
> > To: Flashcoders mailing list
> > Subject: Re: [Flashcoders] Autopopulating from a webservice
> >
> > Well, with a little bit of guidance from Mischa I have this sorted.
> >
> > I had to use an event proxy which was visible from the root, to
> > courier the event from the webservice class I created back to the
> > consuming class, as the addEventListener was not returning to the
> > class if the listener was added to the webservice class...phew..
> >
> > e.g.
> > The following worked (note: this is a selection of code)
> > // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > - - - - - - - - - - - - - - -
> > (in standard class)
> > public function getCategorys(){
> > _root.eventProxy.addEventListener( "categoriesLoaded",
> > populateCategorys );
> > webservice.getCategorys();
> > }
> >
> > (in webservice class)
> > function getCategorys():Void{
> > wsCall=webService.getCategories(wsPassword);
> > wsCall.onResult=function(result):Void{
> > trace("webservice returned");
> >
> > _root.eventProxy.triggerEvent("categoriesLoaded",result);
> > }
> > }
> >
> > (eventProxy class)
> > import mx.events.EventDispatcher;
> > class event_sender{
> > //broadcaster
> > private

Re: [Flashcoders] Autopopulating from a webservice

2005-11-04 Thread Mischa Williamson
You need to access the "result" property of "eventObj". This works well for
me:

import com.ffsys.util.WSProxy;

var listeningObj:Object = new Object();

listeningObj.result = function(eventObj:Object):Void {
trace("###");
trace( "company : " + eventObj.result.company );

for( var z in eventObj.result )
{
trace( z + " || " + eventObj.result[ z ] )
}
}

var ws:WSProxy = new WSProxy( "
http://www.flash-db.com/services/ws/companyInfo.wsdl"; );

ws.addEventListener( "result", listeningObj );
ws.doCompanyInfo("any","any","macr");

Hope it helps.

cheers -- mischa

On 11/3/05, Jeroen Janssen <[EMAIL PROTECTED]> wrote:
>
> Still not getting it :(
>
> I'm using this code with the class Mischa provided but it doesn't work.
> Beware, this is my first time working with listeners so I could do
> something incredibly stupid ;)
>
> var listeningObj:Object = new Object();
>
> listeningObj.result = function(eventObj:Object):Void {
> trace("###");
> trace( eventObj.company );
> }
>
> var ws:wsproxy = new wsproxy(
> "http://www.flash-db.com/services/ws/companyInfo.wsdl"; );
>
> ws.addEventListener( "result", listeningObj );
> ws.doCompanyInfo("any","any","macr");
>
> I already used different methods for the listeningobj but none of them
> seem to work.
>
> Please help :)
>
> Jeroen
>
>
>
> -Original Message-
> From: NEILHIGHLEY.COM  [mailto:
> [EMAIL PROTECTED]
> Sent: woensdag 2 november 2005 19:59
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Autopopulating from a webservice
>
> Well, with a little bit of guidance from Mischa I have this sorted.
>
> I had to use an event proxy which was visible from the root, to
> courier the event from the webservice class I created back to the
> consuming class, as the addEventListener was not returning to the
> class if the listener was added to the webservice class...phew..
>
> e.g.
> The following worked (note: this is a selection of code)
> // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - - - - - -
> (in standard class)
> public function getCategorys(){
> _root.eventProxy.addEventListener( "categoriesLoaded",
> populateCategorys );
> webservice.getCategorys();
> }
>
> (in webservice class)
> function getCategorys():Void{
> wsCall=webService.getCategories(wsPassword);
> wsCall.onResult=function(result):Void{
> trace("webservice returned");
>
> _root.eventProxy.triggerEvent("categoriesLoaded",result);
> }
> }
>
> (eventProxy class)
> import mx.events.EventDispatcher;
> class event_sender{
> //broadcaster
> private var controller:Object;
> public var dispatchEvent:Function;
> public var addEventListener:Function;
> public var removeEventListener:Function;
> function event_sender(){
> EventDispatcher.initialize( this );
> }
>
> function triggerEvent(sEvent:String,oValue:Object){
> trace("proxy triggered");
> var eventObject:Object = {target:this,
> type:sEvent,result:oValue};
> dispatchEvent(eventObject);
> }
> }
>
> (and in root..)
> var eventProxy:event_sender=new event_sender();
>
> // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - - - - - -
>
> It seems to me that actionscript still loses references to remote
> objects within its code and without referring to a global you cannot
> link two objects via events.
>
> If you can suggest an easier way of doing this, or point out that Im a
> noob and show me a proper way, Im all ears.
>
> Neil
>
>
> --
> www.neilhighley.com 
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Autopopulating from a webservice

2005-11-02 Thread Mischa Williamson
Hey,

I've uploaded a simple WSProxy class that should help you with this:

http://freeform-systems.com/share/actionscript/WSProxy.as

You will want to change the EventDispatcher class to MM's version. Change
this line:

import com.ffsys.events.EventDispatcher;

to wherever MM's class is, it i remember correctly it should be:

import mx.events.EventDispatcher;

Then you can use it like this:

var ws:WSProxy = new WSProxy( "http://www.domain.com/service.wsdl"; );
ws.addEventListener( "result", this );
ws.addEventListener( "fault", this );
ws.callSomeMethodWithArgs( arg1, arg2 );

Hope it helps.

cheers -- mischa

On 11/2/05, NEILHIGHLEY.COM  <[EMAIL PROTECTED]>
wrote:
>
> Hello all,
>
> Webservice question..
>
> I have an app that loads in records from a webservice class using the
> mx.services.webservice classes.
> This is called as a standalone class with the various webservices as
> functions each containing their own event listeners..
>
> e.g.
> function wsRequest():Void{
> if(_root._webServicePending==false){
> _root._webServicePending=true;
> wsCall=webService.fileList();
> wsCall.onResult=function(result):Void{
> _root._xmlFileList=result;
> _root._webServicePending=false;
> }
> wsCall.onFault=function(fault:Object):Void
> {
> _root._wsFaultID=fault.faultcode;
> _root._wsFaultDescription=fault.faultstring;
> }
> }
> }
>
> As you can see I am using a couple of root variables to store the
> status of the current webservice request ( restricting the class to
> one call at a time ) and the resulting xml returned.
>
> What I would like to know how to do is to have a class that can query
> the webservice and populate itself, without having the go-between of
> placing the result in the root.
> So the onResult passes the result to the calling class in one way or
> another.
> Preferably I would like the result returned to a callback of some
> sort, would I use event dispatch? How would I do it, considering I
> have a class as follows.
>
> class myClass{
>
> var theFileList:XML;
> var thisWebService:WebService;
>
> function myClass(){
>
> }
>
> function getFileList(){
> theFileList=thisWebService.wsRequest(); //this obviously doesnt work
>
> }
> }
>
> Would I add a listener somewhere?
> Would I create a listener in the root?
>
> Neil Highley
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders