Solved

Calling Flash function from Director

Posted on 2011-03-08
8
776 Views
Last Modified: 2013-12-20
I'm using ActionScript3, FLash CS5 and Director 11.5.

I have a Director app with a Flash component in it.
I want to be able to call a function in my Flash component from my Director code.

I can call a function in Director from my Flash component using "NavigateToUrl" function.
Is there something that easy from Director to Flash?

Also, can i pass variables from Director to Flash?

With Thanks
0
Comment
Question by:jasonb2
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 2

Expert Comment

by:nycynik
ID: 35086945
As far as I know, the answer is no.

This is the way to do it if you embed it in HTML.

<object ...>
<param name=movie value="Flash/test.swf?x=123">
<embed src="Flash/test.swf?x=123"...></embed>
</object>

Open in new window


then use it in flash like this:
myURL = this._url;
myPos = myURL.lastIndexOf("?");
myParam = myURL.substring(myPos,myURL.length);
//this returns the querystring elements - you can now split these using split	

Open in new window

from http://www.actionscript.org/forums/showthread.php3?t=10586
0
 
LVL 2

Expert Comment

by:nycynik
ID: 35086972
I wanted to include one more link, this is from adobe

http://kb2.adobe.com/cps/142/tn_14253.html
0
 
LVL 7

Expert Comment

by:Chris-Chambers
ID: 35088308
Hi,

Yes you can, is your Director app running in a browser or as an .exe app?

Chris.
0
 

Author Comment

by:jasonb2
ID: 35088861
Hi Chris,

We have two versions - One runs in a browser, the other as an exe.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:Chris-Chambers
ID: 35089130
Hi,

I do this all the time in exe apps, I've not tested in a browser, but I would think it should work the same.

If you have a function in Flash eg:

function setIconScale(x_pos:Number, y_pos:Number) {

// Do something

}

You can call it from Director by saying:

sprite("NameOfYourFlashSprite").setIconScale(_mouse.mouseH, _mouse.mouseV)

Easy as that.

Hope this helps,

Chris.
0
 

Author Comment

by:jasonb2
ID: 35089341
Unfortunately your method works with AS2 but not with AS3.
0
 
LVL 7

Expert Comment

by:Chris-Chambers
ID: 35098529
Yes I am using AS2. Why has that broke??

Could you compile in AS2 by any chance?

Chris.
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 125 total points
ID: 35150856
I haven't used Director since version 8 so i did some googling.

http://groups.google.com/group/macromedia.director.basics/browse_thread/thread/85203d2879267fe1?pli=1

if you're still using version 11 then i'm guessing what was mentioned there still holds true
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now