|
|||
|
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);
}
}
}
Code:
import com.login.update.*; var updating:UpdateFiles = new UpdateFiles; updating.init(); 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. |
|
|||
|
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");
}
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);
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|