Director Array to Flash Array?
I'd like to be able to create an array in Director, and then
pass that array object into Flash and use it there. I can use
Director to manipulate a Flash array, but I haven't been successful
in passing an array object.
Any help?
If you have the new (at least more recent) Director 10.1
update with the
new Flash Asset Xtra, you can use the brand spankin new
convert() method
to do just that.
Here is a technote (pdf) about how to use it:
http://www.adobe.com/support/director/flash_8_asset_xtra.pdf
Similar Messages
-
Passing flash array to flash sprite
Hi,
I am trying to pass a flash array like [{x:1,y:2},{x:1,y:2},{x:3,y:5}] from a flash sprite to Director lingo and back to another flash sprite. In director all looks fine when passing it back to the second sprite but the flash trace command just gives me undefined values. Can't I do this in lingo?
in lingo:
put " flashAry.length " & flashAry.length
flashObject.DrawAry(flashAry,"testxy")
Output window:
-- " flashAry.length 23.0000"
in ActionScript
function DrawAry(points:Array,test){
trace(">DrawAry " + points + " " + points.length + " >" + test + "<")
Output window:
-- >DrawAry undefined undefined >testxy<Had a very similar problem and found a solution...
Hope this helps....
-- This GETS an array from Flash to Director
-- 'myFlashArray' is the name of the array in your Flash file
-- 'flaArray' is the new list created in Director
-- And obviously, the flash file is on sprite 1
flaArray = convert(#list, sprite(1).myFlashArray)
put flaArray
-- This SENDS a Director list to flash (as an array)
-- 'zz' is just a temporary variable so the script is easier to read
-- 'dirList' is your Director List
-- 'myNewFlashArray' is the name of the newly created array in your flash file
-- again, the flash file is on sprite 1 in this case
dirList = ["item 1","item 2","item 3"]
zz = convert(#flashObjectArray, dirList).toString()
sprite(1).createVariable(#myNewFlashArray, zz )
NOTE: I'm using an undocumented 'convert' function that is only available in Director 10.1.1 onwards... -
Helpppp! my flash array will only play the first frame
my flash array will only play the first frame
this is the code
stop();
var t:Timer=new Timer(100,0);
t.addEventListener(TimerEvent.TIMER,preloadF);
t.start();
var rdmFrame:Array = ["15","150","420","589","712","807","1135"];
stage.addEventListener(MouseEvent.CLICK, fnClick)
function fnClick(e:MouseEvent):void
trace(rdmFrame[numberRange(0, rdmFrame.length)]);
function preloadF(e:TimerEvent)
if(this.framesLoaded>7)
t.stop();
t.removeEventListener(TimerEvent.TIMER,preloadF);
t=null;
this.gotoAndPlay(numberRange(0, rdmFrame.length - 1));
function numberRange(minNum:Number, maxNum:Number):Number
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);Ned Murphy wrote:
Your timer function is not using the array, it is just using the random number. Adapt what you have in the fnClick function.
Hi Ned ,
I am a little confused , sorry .. i am not sure what you mean...i am very new at AS3 ...
I dont even need the click function .. another developer recommended it as a way to track the random action..
stop();
var t:Timer=new Timer(100,0);
t.addEventListener(TimerEvent.TIMER,preloadF);
t.start();
var rdmFrame:Array = [15,150,420,589,712,807,1135];
function preloadF(e:TimerEvent)
if(this.framesLoaded>7)
t.stop();
t.removeEventListener(TimerEvent.TIMER,preloadF);
t=null;
this.gotoAndPlay(numberRange(0, rdmFrame.length - 1));
function numberRange(minNum:Number, maxNum:Number):Number
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum); -
Does Times Ten work with External Flash array
Does the Times Ten In Memory DB support external Flash Arrays or is it completely dependent of Internal Memory. I was told it did not support it in the past, as this changed recently.
TimesTen supports normal RAM for primary storage and 'disk' (or anything that presents as a disk, such as SSD etc.) for persistent storage. There is no explicit support for any other kind of storage. If the O/S had the capablility to present an external Flash Array as normal RAM then in theory it would work with TimesTen. But of course it would be far, far slower than RAM so there is probably little benefit in doing that even if it were possible.
Chris -
Array Comparison ( Flash 8 )
Hello,
I am trying to write a function that will "highlight" days
in a month--for a calendar I'm making.
The dates I have come in from PHP/MySQL look like this:
YYYY-MM-DD.
I split up the date by "year", "month" and "day" then put
them into an array like so:
////CODE////
function editDateResults( d:Array ){ // d = an array full of
dates formated YYYY-MM-DD
for( var i:Number=0 ; i < d.length ; i++){
year.push( parseInt( d
.substring( 0 , 4 ) ) );
month.push( parseInt( d.substring(5 , 7 ) ) );
day.push( parseInt( d
.substring(8 , 10 ) ) );
}//end for
}//end function
////END CODE////
How do I take those arrays and line them up with my Calendar
days.
I tried something like this. DON'T LAUGH! It worked kind of!
LOL
////CODE////
var l:Number = 0;
var d:Number = 0;
var count:Number = 0;
function highlightDay( ){
count = 0; //reset;
while( true ){
count++;
l++;
l %= month.length;
d++;
d %= 31;
if( monthsByNumber[n]+1 == month[l] and d == day[l] ){ // n
= a number changed by pressing "next" or "prev" button
var DayColor = new Color( Calendar["daycube"+ d] );
//Calendar = main clip. "daybube" is just a little cube with a
number representing the day ( inside Calendar ).
var colorTransform:Object = { ra:50 , ga:50 , ba:50 };
DayColor.setTransform( colorTransform );
Calendar["daycube"+d].hasEvent = true;
Calendar["daycube"+d].eventNumber = l;
}else{
var DayColor = new Color( Calendar["daycube"+d] );
var colorTransform:Object = { ra:100 , ga:100 , ba:100 };
DayColor.setTransform( colorTransform );
Calendar["daycube"+d].hasEvent = false;
}//end if
if( count >= ( month.length * 31) ){ break }; //how many
times to check
}//end while
}//end function
////END CODE////
Thanks for any help you can give!Never mind. I figured it out!
-
Can't duplicate movieclips as an array within an array
Hello.
I have an animation that loads an xml into it and traces back
an array within an array. I have tried to apply this to duplicated
movieclips thereby creating a structured set of links. What I am
trying to do is this:
Chicken Nuggets
__Compression
__Texture
__Disgust
Mega Warhead
__Taste
__Hardness
__Pain
This traces fine but I can't seem to get the duplicated
movieclips to assemble in this fashion.
The code for the XML is as follows:
var controlArray:Array;
var variable:Array;
var testTopic = new Array ();
var test = new Array ();
var controlsXML:XML = new XML();
controlsXML.ignoreWhite = true;
controlsXML.onLoad = function(success:Boolean){
if (success){
var mainnode:XMLNode = controlsXML.firstChild;
var controlNodes:Array =
controlsXML.firstChild.firstChild.firstChild.firstChild.childNodes;
var list:Array = new Array();
for (var i:Number = 0; i < controlNodes.length; i++) {
var personnode:XMLNode = controlNodes
.attributes.Name;
trace(personnode);
testTopic.push (new struct (personnode));
var specificNode:Array = controlNodes.childNodes;
for (var j:Number = 0; j < specificNode.length; j++){
var itemnode:XMLNode = specificNode[j].attributes.Variable;
trace(itemnode);
test.push (new struct2 (itemnode));
printer ();
printer2 ();
} else {
trace('error reading XML');
controlsXML.load ("controls3.xml");
The code for the movieclip duplication is as follows:
x = 50;
function printer ()
for (m = 0; m < testTopic.length; m++)
duplicateMovieClip ( slotTopic, "slotTopic" + m, m );
slotTopic = eval ( "slotTopic" + m );
slotTopic._y += x;
slotTopic.slotTopicContent.text = testTopic[m].personnode;
function printer2 ()
for (k = 0; k < test.length; k++)
duplicateMovieClip ( slot, "slot" + k, k );
slot = eval ( "slot" + k );
slot._y += x;
slot.slotContent.text = test[k].itemnode;
function struct (personnode)
this.personnode = personnode;
function struct2 (itemnode)
this.itemnode = itemnode;
On the stage are two movieclips, titled "slotTopic" and
"slot". Within those are dynamic text boxes titled respectively
"slotTopicContent" and "slotContent". When I preview this file it
only displays the text within the "slot" movieclip and it lists all
six of the subtopics with no break. So, there are two dilemmas:
1) The movieclips won't duplicate into the structured set of
links that I want.
2) "slotTopic" is not displaying text at all.
If anyone has any advice, I'd really appreciate it.
Thx!ok, I'm sorry but there are quite a few things wrong here.
first though, when posting code please use the 'attach code'
button.
1) i can't imagine that you have a XML structure as deep as
your calling to or the need for it with the limited amount of
infomation your pulling, in addition your storing the info in
attributes, so I can't see how this would work, it may 'trace' out
the right text (somehow) but it's not getting into the arrays
properly.
2) you do not assign an attribute value to a XMLNode, and
then try to push it into an array.
3) you do not call a method (struct or struct2) using the
'new' operator. this is how you envoke a new 'class' instance.
4) do not use 'x' as a variable name as it is a reserved var
in flash, assigned to an Object instance.
5) the duplicateMovieClip() method needs to be called upon
the existing clip as in:
slotTopic.duplicateMovieClip('slotTopic'+m, m);
additionally you can pass the _y placement within the
initObject.
6) you do not need to use eval, it isn't doing anything here,
you will gain the correct path by calling duplicateMovieClip
correctly.
7) the reason why slotTopic is not being displayed at all is
because of the second loop, you are duplicating the clips
(incorrectly) into the same depths thereby replacing all of the
contents of the slotTopic depths previously constructed.
the solution to this problem is to construct both items with
the same loop but increament one of the depth assignments by a
specific number, in other words at depths much higher or at least
different, than that of the first element, as in:
slotTopic.duplicateMovieClip('slotTopic'+m, m, {_y:50});
slot.duplicateMovieClip('slot'+(m+100), m+100, {_y:50});
again I'm sorry man, but it will take some work to sort this
out. -
Array[1] vs array.GetItemAt(1)
Hello,
what is the difference between array[1] and array.GetItemAt(1)?
With [] Flash Builder tells me the databinding couldn't recognized any changes!? But why?
Thank you!
- bbThat's correct you can filter the output of the AC so it only shows by lastName or whatever database field you want.
http://blog.flexexamples.com/2008/03/12/using-a-combobox-to-filter-items-in-a-datagrid-in- flex/ -
Can anybody tell me how to create pointers in an array pointing to other arrays?
RichL wrote:
Hi tbob,
thanks for your suggestion! I did build it up with three arrays and a numeric control to select one of the arrays, which works fine. However, there are the following effects which I don't understand yet.
1. The RefArray can only be defined as Variant, showing a violet colour instead of a green/blue as in your example; I could not find a refnumber without giving me an error.
2. By changing the array selector, following array elements are being written into: 1,1 of array0; 0,0 of array1 and 1,0 of array2. I don't see why it is different for each array. Is there a possibility to select the array element being written into?
My VI is attached, LV7.1
Kind regards
Richard
Strange, when I created my vi, the RefArray was blue-green, not a Variant. On the front panel I placed a blank array. Then I placed a Control Refnum into the array. Now the array is defined as a Control Refnum Array, not a Variant.
Attached is a vi similar to the picture I had previously attached. In your case, you would need a slightly different method because of your unknown quantities of channels for each source. The use would select a source, and then you would have to retrieve an array of channels for that source. The user then selects a channel, and you would have to retrieve the data for that channel.
Post what you have so far so that we can look at it.
- tbob
Inventor of the WORM Global
Attachments:
RefArray.vi 50 KB -
Mapping vertical arrays versus horizontal arrays in HP exstream
Anyone with details on mapping vertical arrays versus horizontal arrays in HP Streak software please?
johnsold wrote:
Is this a bug (inconsistent behavior)? A feature? An unintended consequence of something else?
I agree, this looks inconsistent.
Ranjeet_Singh wrote:
Make the index of both the array 0 then run your program.
Now horizontal array shows 4th element & vertical array shows 10th element.
What are you trying to say here? You are just repeating the instruction #1 on the front panel of the posted VI, then repeating what the image above already shows.
LabVIEW Champion . Do more with less code and in less time . -
Load a director level into flash // is it possible?
Hi,
I am planning a complex system where eventually users will need to do immersion into 3rd dimension and also play lots of flash quizz.
I know director can load flash which makes it obvious choice for development but coding in lingo (a non POO language) maybe a little bit of regression looking the average age of the development team that iam building. So looking forward, i wonder if it's possible to make flash load director levels.
Thank youVenian,
Director used to be considered flash's big sister: http://www.adobe.com/products/director/
Btw i just found out that you can use javascript within Director making it then perfect choice for my project. -
Assigning javascript array with jsp array
hi,
I have a jsp page where I have a array in jsp. I want to assign the values to an javascipt array. how can I do that?
the reason why I want to do this is for a perticular problem I am facing in javascript. that is....
I have a text box in my jsp page, I want the value entered in that box to be checked (whether it exists ) against a hidden string which has some value. I want that hidden string not to be shown to the user even on seeing the html source. that is why I want these values to be stored and checked against a array object of javascript.
any suggestion is appreciated
Thanks
AshutoshHai asutoshdash
if you dont mind of viewing code u can use this else dont use, its not matters weatehr user will see you code or not if the user is professiona then its a big issue normal users not think of is for this dont send valuable infos like password etc to client u may send usernames
ok to create a java array to javascript array do this (i took example of db to array ) write this inside <script> <%codes here%> </script>
var aUsername =new array();
<%
int i=0;
while (rs.next())
%>
aUsername[<%= ++i%>] = "<%= rs.getString("User_Name")%>";
<%
%>thats it use this array where ever you want in your client side(javascript ) usage
hope this will help you
archi -
hi guys
is it posible to place one array inside another array?
something like
public double[] dblarray(int n)
double [] dbl2 = new double(n)
return dbl2;
public double[] dbl2array(int m,int n)
int n=10
double [] dbl2 = new dobule[m];
for(int i = o;i < m ; i++)
dbl1=dblarray(n)
if tryed it an it told me its wrong. does any one know how to do it or if it is posible since i come from ansi c i know this is posible in c but is it in java???
pleas help:)
thanks
jelielNo, it's not possible in a strict sense. Java is more type safe than C - in C there is no real array type...
What you can have is an array of references (=pointers) to arrays of doubles, or double[][], and what your code does is more commonly written asdouble[][] dbl2 = new dobule[m][10]; -
Cast Object Array to String Array.
When I try to cast an object array to string array an exception is thrown. How do I go about doing it?
Vector temp = new Vector();
Object[] array = temp.toArray();
String[] nonterms;
nonterms = (String[])array;
Thanks,
AllyTry this
import java.util.Vector;
public class Test
public static void main(String args[]) throws Exception
Vector v = new Vector();
v.add("a");
v.add("b");
v.add("c");
Object[] terms = v.toArray();
for(int i = 0; i < terms.length; i++)
System.out.println((String)terms);
Raghu -
Can I import Director movies into Flash?
Hi,
Can Flash handle Director movies? I am making a presentation
of my artworks in Flash environment; I have both Flash and Director
movies. I know that I can import all my swf movies into Director
MX2004 to create a standalone projector and play both swf an ddir
movies. Does it work for the reverse?
Thanks
UtiNo, you can't import or display Director movies in Flash in
any way. Best
you can do is launch the Director executable from the Flash
movie, though
how you do this depends on which version of Flash you are
using.
Remove '_spamkiller_' to mail -
Using a director XTRA in flash actionscript: possible or
impossible?supurdupur wrote:
> Using a director XTRA in flash actionscript: possible or
impossible?
not possible
Best Regards
Urami
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>
Maybe you are looking for
-
I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?
-
hi all, I am sending a PO request using the send step and waiting for a PO response using the recieve step. Assume that i have two instances of this BPM running i.e two PO request's going simultaneously. when i get the response back for these two req
-
How do I get rid of the small little category boxes that all my apps are assigned to every time I sync my iTouch? I pull them all out and rearrange them and when I sync everything is rearranged.
-
Hi all, I have placed some repeating conditions in many places of the query , Please suggest me to reduce the size of the query . SELECT (CASE WHEN prs.rqst_ctgry_lkpcd <> 'AR' AND prp.x12_code_list_qlfr_lkpcd <> 'HC' THEN prp.x12_code_list_qlfr_lkpc
-
Well, after more research on the soon-to-be-released K8N motherboard, I believe there are enough significant changes to this mobo that it might be worth a try. Big news is the AGP/PCI lock - but if you take a real good look at the photos, you'll noti