|
-
A little taste of what your going to find when you open your brand spanking new Flash MX box or .exe(if you use electronic download)
You can now communicate with all the .swf files open on the users computer using the LocalConnection class and connections, this deminishes the use of javascript to communicate between flash movies in different windows, heres a code sample, lick your lips:
Code:
obj = {a:"a",b:1,c:[1,2,3,4]} //set up an object to send to the recieving .swf files
lc = new LocalConnection();
lc.send("incoming", "onSendObject", obj);
And then in the recieving .swf(s):
Code:
lc=new LocalConnection()
lc.onSendObject=function(theObj){ //set up a function which recieves the data sent from the sending movie
trace(theObj.a)
trace(theObj.b)
for(var i in theObj.c){
trace(theObj.c[i])
}
}
lc.connect("incoming"); //make a connection to the "incoming" channel
MOooooohhhhaaaawww!!
[Edited by FlashGuru on 03-05-2002 at 08:32 PM]
-
World Kit Vote Holder
Wow.
Now let me ask you about the second snipet of code, where the "for" statement comes in:
Where did you declare (or define) var i?
And:
Does the for statement assume an auto-increment in there?
Sorry about my ignorance, if this question bothers you (I am still more used to program in VB-look-alike languages than Java-look-alike languages).
-
Other new classes?
Hey, that's pretty nice!
Would you mind telling us a little bit about these new classes? Are there a lot of them? What about the new drawing API? I also heard about new XML functionalities... what's the scoop?
Hey, how about you create a special thread for Flash MX ActionScript geeks... 
Thx...
-
I like the look of this. Question about the code, in particular these lines:
lc.send("incoming", "onSendObject", obj);
lc.onSendObject=function(theObj){
Is onSendObject a name you picked or is it defined by the LocalConnection class? If it's the latter, are there many other event names that one of these objects can respond to? I ask mainly because in the first line, "onSendObject" is a string, which obviously means it could be other values.
-
Originally posted by Abelius
Wow.
Now let me ask you about the second snipet of code, where the "for" statement comes in:
Where did you declare (or define) var i?
And:
Does the for statement assume an auto-increment in there?
Sorry about my ignorance, if this question bothers you (I am still more used to program in VB-look-alike languages than Java-look-alike languages).
for(var i in obj){}
is an iterator statement which iterates over every property/method of an object.
-
Originally posted by The Yellow Yell
I like the look of this. Question about the code, in particular these lines:
lc.send("incoming", "onSendObject", obj);
lc.onSendObject=function(theObj){
Is onSendObject a name you picked or is it defined by the LocalConnection class? If it's the latter, are there many other event names that one of these objects can respond to? I ask mainly because in the first line, "onSendObject" is a string, which obviously means it could be other values.
onSendObject is a named i picked:
Code:
lc.send("the_channel", "the_function_to_call",the_data_to_send);
-
World Kit Vote Holder
Thank you, FlashGuru!
So, if I understood it right, I was confusing the for word with the for in word... hihihi...
-
MoiK78 Flasher
Can't you imagine the possibilities of this feature???
This could be use to exploit someones work!!! Imagine you have a window open with a Flash website and in another window you are surfing and suddenly a pop-up contains a swf that ruin the Flash website... could it be possible???
Because if it's there's a serious risk with the many thousands hackers and crackers..... this could be a "backdoor".....
-
you'd have to know the name of the function that the person set up in the receiving movie, no?
-
Flash Developer on a break
moises, BOTH movies must have this code. Else it won't work.
-
COM objects
Can a COM object use this as a way to pass n number of objects to the SWF file?
If I understand it correctly, LocalConnection() is a server/client relationship?
For example in MF5 the String.split() is very slow if you have a long string. (I realize that the performance is increased in FMX) I'd like to do the split and maybe even a little math on the string in a COM object and just output to the SWF to display.
------ Update ---
Oh, Answer found in..
http://download.macromedia.com/pub/f...s/security.pdf
Sweet..
[Edited by SCDYNE on 03-06-2002 at 04:57 PM]
-
Getting Connected
I don't have my copy of Flash MX yet so can't play with the rest of you yet but I was wondering if anybody knows of a way to use local connections to talk to other swf not on the same machine.
I am trying to do this without going back to a server so I am looking at establishing some form of direct peer to peer connection on a LAN.
Any ideas or any other suggestions welcome...
-
build a shell
-
Gross Pecululatarian
Doesn't Local Connection suggest somthing?
-
[Devil in DarkGreen]
yea,it seems local connection class can do some cool thing,adding shared object,it's a cool temp local server.
D S
-
check out my example 
all i did was create new localConnection objects... so that it ends up something like:
lc.send("incoming", "onSendObject", obj);
lc2.send("incoming2", "onSendObject", obj);
lc3.send("incoming3", "onSendObject", obj);
...
...
...
-
Connectable
Has to be downloadable and work in the browser as opposed to being an installed app.
As for what local implies? Well Ed, there is nothing in a name. I was thinking:
Local connection; Local PC; Local Network; Local Access to Local Settings; Local Facilities; Local Knowledge; Local Shop for Local People; Local pub; Locality; Loch Ness; Locks; Locksmith; Local Server; Local Connection.
Simple to follow, eh?
The facility is not as useful as it could have been if it was able to access local network clients on other machines peer to peer without having to communicate through the server. Shame.
-
Just a quess
Isn't it possible to use this piece of code:
Code:
System.security.allowDomain(domain1, domain2,....domainN)
and combine it with the localconnection() to access a movie located somewhere else on another server.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|