u glavnom FLA fajlu u prvom frejmu imam ceo kod a na početku imam varijablu
var myToken = "blablabla"
dakle, nekakav token.
Taj token bi hteo kao varijablu da prenesem u klasu u naravno drugom .AS fajlu.
Sve to lepo radi ako direktno unesem vrednost tokena u varijablu "mytoken" u klasi, recimo "#ed%h0#w@1"
Ako pokušam da varijabli "mytoken" dodelim vrednost "myToken1" varijable iz glavnog FLA skripta, program prijavljue grešku nedefinisanog "myToken1"
(vidi crvenu varijablu)
Da li postoji migućnost da klas akoristi neku varijablu iz glavnog FLA fajla?
Za pomoć sledi pivo bilo koje vrste :)
package com.wowza{
import flash.net.*;
import flash.events.TimerEvent;
import flash.events.NetStatusEvent;
import flash.utils.Timer;
import fl.video.*;
import com.wowza.encryptionAS3.TEA;
use namespace flvplayback_internal;
public class WowzaNCManagerAS3 extends NCManagerNative implements INCManager {
flvplayback_internal override function connectOnStatus(e:NetStatusEvent):void {
var mytoken = myToken1;
//"#ed%h0#w@1";
//var sharedSecret:String = "#ed%h0#w@1";
var sharedSecret:String = mytoken;
if (e.info.code == "NetConnection.Connect.Success") {
if (e.info.secureToken != undefined) {
e.target.call("secureTokenResponse", null, TEA.decrypt(e.info.secureToken, sharedSecret));
}
}
super.connectOnStatus(e);
}
}
}
Code:
package com.wowza{
import flash.net.*;
import flash.events.TimerEvent;
import flash.events.NetStatusEvent;
import flash.utils.Timer;
import fl.video.*;
import com.wowza.encryptionAS3.TEA;
use namespace flvplayback_internal;
public class WowzaNCManagerAS3 extends NCManagerNative implements INCManager {
flvplayback_internal override function connectOnStatus(e:NetStatusEvent):void {
[b][red]var mytoken = myToken1[/red][/b];
//"#ed%h0#w@1";
//var sharedSecret:String = "#ed%h0#w@1";
var sharedSecret:String = mytoken;
if (e.info.code == "NetConnection.Connect.Success") {
if (e.info.secureToken != undefined) {
e.target.call("secureTokenResponse", null, TEA.decrypt(e.info.secureToken, sharedSecret));
}
}
super.connectOnStatus(e);
}
}
}
package com.wowza{
import flash.net.*;
import flash.events.TimerEvent;
import flash.events.NetStatusEvent;
import flash.utils.Timer;
import fl.video.*;
import com.wowza.encryptionAS3.TEA;
use namespace flvplayback_internal;
public class WowzaNCManagerAS3 extends NCManagerNative implements INCManager {
flvplayback_internal override function connectOnStatus(e:NetStatusEvent):void {
[b][red]var mytoken = myToken1[/red][/b];
//"#ed%h0#w@1";
//var sharedSecret:String = "#ed%h0#w@1";
var sharedSecret:String = mytoken;
if (e.info.code == "NetConnection.Connect.Success") {
if (e.info.secureToken != undefined) {
e.target.call("secureTokenResponse", null, TEA.decrypt(e.info.secureToken, sharedSecret));
}
}
super.connectOnStatus(e);
}
}
}