Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-28-2007, 01:50 PM
Junior Member
 
Join Date: Jan 2007
Posts: 13
Default getVariables in Flash 9

Hi!

I downloaded Flash 9 public alpha from adobe, and i have some proplems with as3 and ffish script get/set variables.

i write a package for update files (xml, swf, and image files) to my prog.
Code:
package com.login.update
{
import SWFKit.*;
        public var filetoupdate:String;

public class UpdateFiles 
{
               public function init ():void {
                         //checking file versions and get file names and locations
                         //..
                         //......
                         filetoupdate = "engine.swf";
                         //in ffish scipt resolvFile is a function for inet.ongeturl event
                         ExternalInterface.addCallback("resolvFile", dlProgress);
                         //runs the download script
                 ExternalInterface.call("ffish_run", "download");
               }
           
                public function dlProgress(type:String, dlstatus:String):void {
                            swfkit_trace("File download at progress: " +dlstatus+" bytes);

                }

        }
}
and my swf first frame has :

Code:
import com.login.update.*;

var updating:UpdateFiles = new UpdateFiles;
updating.init();
but i couldnt get filetoupdate variable in swfkit download script section (flashplayer.getVariable) , and callback function (dlProgress) not called.
i tryed many variations but not seems to work
in as2 this works fine, and i get the downloaded file size
my stupid as2 brain.. i know... Can anyone help me?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 03-01-2007, 11:44 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:getVariables in Flash 9

It seems that the "getVariable" method does not work with a class member, just like in flex 2. However, you can use the way introduced in http://www.swfkit.com/forum/thread_1_1807.html

That will work in both as 2 and as 3:

1. define a download method in ffish script ("initialize" script)
Code:
function download(swfile)
{
    filetoupdate = swfile;
    // call the "download" ffish script
    invoke("download");
}
2. in actionscript, call the download method instead of the download ffish script
Code:
 public function init ():void {
                        //checking file versions and get file names and locations
                        //..
                        //......
                        filetoupdate = "engine.swf";
                        //in ffish scipt resolvFile is a function for inet.ongeturl event
                        ExternalInterface.addCallback("resolvFile", dlProgress);
                        //runs the download script
                   ExternalInterface.call("download", filetoupdate);
              }
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:09 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.