Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 05:34
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash and AS 3 (Moderators: papachan, kofi addaquay)
| | |-+  passing a variable from AS 2.0 swf embedded into AS 3.0 flash file
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: 1 2 [3] Print
Author Topic: passing a variable from AS 2.0 swf embedded into AS 3.0 flash file  (Read 5931 times)
jarmanje
Senior Programmer
****
Posts: 334


View Profile
« Reply #30 on: 10/09/07, 22:06 »

for some reason i have got rid of all of the error messages when viewing it in a browsers just by changing the name to conn1

So now the problem left is that when i open two windows of it in my browsers, the new one does not do anything when i click the button which activates the localconnection passing...

Code:
try
            {
myReceiver.connect("conn1");
  }
            catch (error:ArgumentError)
            {
                // server already created/connected
trace("Error! Server already exists\n");
            }
Logged
kofi addaquay
Global Moderator
Senior Programmer
*****
Posts: 450



View Profile WWW Email
« Reply #31 on: 10/10/07, 09:54 »

i dont think the localconnection with will be good for your images application. when using localconnection, communication is many-to-one. That is, there are multiple senders for a specific channel but ONLY a single receiver. so you can send var information as in ur original question BUT considering the kind of application u are building the ExternalInterface is best. i recreated the sample files(zip) you sent to make it work BUT in ur case this is not a good solution. i noticed that when i opened other browers and interacted (from secondary to primary)...the primary got affected.
take this example.  i created a counter, so that every time you click, the counter is incremented by 1. if you opened another swf and hit the button, the first swfs user selection ALSO changed. so if you have 10 windows opened, users interacting with the as2 swf affects only a single swf (ie the as3 swf). hope you understand.
Logged
jarmanje
Senior Programmer
****
Posts: 334


View Profile
« Reply #32 on: 10/10/07, 10:05 »

i've just created a test flash

Here you can see if i test the AS2 on its own, it works fine

then look what happens when you run the AS3 (which loads the as2 file)

here is my test file i made up with 3 small images..

http://www.yoce.com/loadmovieproblem.zip
Logged
jarmanje
Senior Programmer
****
Posts: 334


View Profile
« Reply #33 on: 10/10/07, 10:09 »

Hi kofi, thanks a lot again for your help. I didnt see your last post before i posted mine..

i tried playing with ExternalInterface but i couldnt get anything to work.. i wasn't fully understanding what was happening with so much code.

Do you have a code snippet you think might be helpful to impliment into my flash file i just posted? That is basically a very very broken down version of what i'm trying to do (my actual AS2.0 is much bigger with lots of images)
Logged
jarmanje
Senior Programmer
****
Posts: 334


View Profile
« Reply #34 on: 10/10/07, 10:14 »

sorry before i included the wrong main.fla

now i updated the download
Logged
kofi addaquay
Global Moderator
Senior Programmer
*****
Posts: 450



View Profile WWW Email
« Reply #35 on: 10/10/07, 10:24 »

are you still using localconnection? you might want to open a new post on using external interface to pass image information from one swf to another.
Logged
jarmanje
Senior Programmer
****
Posts: 334


View Profile
« Reply #36 on: 10/10/07, 10:33 »

nope after your explanation i think i can't use localconnection... Sad

But i learnt a lot about localconnection now Cheesy thanks a lot for your help
Logged
Pages: 1 2 [3] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything