Ok, I see the problem:
function getLocal is a static function.
That is, if you make a variable like so
var s:SharedObject;
you can't do this:
s.getLocal("");
but you can do this:
SharedObject.getLocal();
Trying to do this:
override static function getLocal(name:String,localPath:String=null,
secure:Boolean=false):ShareObject{
I get this error:
Functions cannot be both static and override.
But I've never overridden anything before, so I might just have the syntax
wrong.
-David
On Fri, Sep 25, 2009 at 8:34 PM, Eric DeCoff <[email protected]> wrote:
> Yeah,
>
> Tried that.. get error
>
> 1020: Method marked override must override another method.
>
>
> package
>
> com.component
>
> {
>
> import flash.net.SharedObject;
>
> import flash.net.SharedObject.*;
>
> import mx.controls.Alert;
>
> // use namespace mx_internal;
>
> public class AdvancedSharedObject extends SharedObject
>
> {
>
> public function AdvancedSharedObject()
>
> {
>
> super();
>
> }
>
> override function getLocal(name:String,localPath:String,secure:Boolean =
> false):SharedObject{
>
> return super.getLocal(name);
>
> }
>
> }
>
> }
>
> On Fri, Sep 25, 2009 at 4:57 PM, David <[email protected]> wrote:
>>
>> I'm not familiar with this syntax:
>> override getLocal function getLocalAdvanced(...
>>
>> I would think it would just be
>> override function getLocal(...
>>
>> -David
>>
>> On Fri, Sep 25, 2009 at 11:22 AM, Eric DeCoff <[email protected]>
>> wrote:
>> > Hey all,
>> >
>> > What am I doing wrong?
>> >
>> >
>> > <pre lang="mxml">
>> >
>> > package
>> >
>> > com.component
>> >
>> > {
>> >
>> > import flash.net.SharedObject;
>> >
>> > import mx.controls.Alert;
>> >
>> > public dynamic class AdvancedSharedObject extends SharedObject
>> >
>> > {
>> >
>> > public function AdvancedSharedObject()
>> >
>> > {
>> >
>> > super();
>> >
>> > }
>> >
>> > override getLocal function
>> > getLocalAdvanced(name:String,localPath:String,secure:Boolean =
>> > false):SharedObject{
>> >
>> > try {
>> >
>> > return super.getLocal(name);
>> >
>> > }
>> >
>> > catch (e:Error) {
>> >
>> > Alert.show(e.message.toString(),
>> >
>> > "Error Opening Shared Object")
>> >
>> > return null
>> >
>> > }
>> >
>> > }
>> >
>> > }
>> >
>> > }
>> >
>> > </pre>
>>
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, simply email the list with unsubscribe in
>> the subject line
>>
>> For more info, see http://www.affug.com
>> Archive @ http://www.mail-archive.com/discussion%40affug.com/
>> List hosted by http://www.fusionlink.com
>> -------------------------------------------------------------
>>
>>
>
>