ActionScript 3.0 :: Flash Passing MovieClip Object As Variable
Sep 20, 2010
I'm relatively new to Flash and ActionScript and have a problem with the following code I'm putting together:
Code:
// creating a new testmclip object
var testmclip = new testmclip(); // creating a new testmclip object
/* create a new pop up menu
- sending the testmclip as var and "test" as label */
popupmenu = new Menu ([path: testmclip, label: "test"]);
I'm trying to send a movieclip object created in one class, to a different class - for the latter class to add as it's child. The code was originally Kevin Hoyts Android Component for Menu and MenuItem [URL] ... but in that the path for the menuitem was a path which loaded from url or relative path --> this I can't do with flash...I think.
View 2 Replies
Similar Posts:
Jul 30, 2009
I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip...please see the 'PROBLEM' stated in the code below.
Code:
stop();
var placesXML:XML =
<places>
<place name= "Yogyakarta">
[code]....
why do you want a variable to hold the value in the node <marker>, when that value is identical for each node, ie. it is always 'myMarker_mc', so why not just directly declare the variable 'xmlMark' as myMarker_mc. The reason is; the value in some of the <marker> nodes will soon be changing to 'myMarker_mc2' - a slightly different movieClip which I may need to call depending upon which place @name is chosen.This is the new output thrown up by the variable XMLmarkers
Code:
<marker>
myMarker_mc
<myText>
[code]....
View 16 Replies
Oct 26, 2009
I have a movieclip that will load an external picture from a given path, it works fine if I hardcode the picture path. In the scene I added this moveclip at runtime, but now I have problem to pass in the a string path value to the movieclip so that in can load a correct picture.
View 2 Replies
Jul 30, 2009
I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip. 'PROBLEM' stated in the code below.
[Code]...
View 6 Replies
Dec 23, 2009
I have list that is generated from a database that when click it calls a seperate movieclip in the library called comments and loads data from the database in it. I the movieclip i have buttons that I am trying to pass the data to but it doesnt seem to be working.
here is my actionscript:
getReleaseInfo_Result = function (releasesID,track1url,track2url,track3url,track4ur l) {
_root.container.attachMovie("comments", "comments", 100);
_root.container.comments._x = 325;
[code]....
View 4 Replies
Jul 11, 2010
im trying this every which way.creating global variables etc.I have a movie clip with a text area (lets call it txttest)there is text inside it which i want to send from this movieclip on the main frame to a text area (lets call that one txttestB) on the main frame. Whatever i try i get undefined in the text area on the main frame.I have tried this...
_global.selectedcompany = txttest.text;
_root.txttestB.text = _global.selectedcompany;
View 1 Replies
Aug 26, 2011
I'm trying to pass the file name of an image upload PHP script into Flash's UILoader component. So when a user uploads their image, the file name of the file is passed to flash so that the image displays within the Flash UILoader application. Here's the PHP variable I'm trying to pass: $filename= ''; And here's where Flash's UILoader gets it's source (ActionScript 3.0): uiLoader.source = "freshly uploaded file.jpg ($filename)?";
View 1 Replies
Sep 4, 2009
Here are what I'm having:
<?PHP
$testVal = "This is a test";
$test = urlencode($testVal);
[code].....
View 7 Replies
Mar 7, 2011
I have a rather simple flash application users can make a quick username when connected, and the username is created inside the flash swf.
Now, I have a cron job deleting inactive usernames every ten minutes (on my mysql database where these usernames are all stored and accessed by the other people online) which is fine. But it can still get cluttered up if a bunch of people sign off at once, there is still that 10 minute window before the cron job clears them.
The users have an option to click log out in the flash application which is fine and works great. But of course many choose not to click log off they just click the browser x.
I've looked into onbeforeunload and jquery's .unload but I still need a way to get the username variable that's IN flash INTO the HTML, then use a php script to run the delete username mysql query.
If not, any insight on how I might pass the username variable to the html to hold onto it after the user makes their username so it can be involved with the .unload function running the php script?
EDIT::::: Maybe is there a way to create a UNIQUE string of numbers with php then pass that var to flash to include with the mysql row then since i already have that var since it was created on the html side, just along with the unload, have it delete the row that has that unique id?
If anyone things this idea would be the best approach, and if i used something like md5(uniqid(microtime()) . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']) to make a random iD how could i go about storing the result in a var i could place in the flash vars param then again in the jquery unload or javascript onbeforeunload if that would be better .
View 2 Replies
Aug 4, 2009
I need to have something like this in a html file
CODE:
And so on....
Then i must get values from "item1" and get them into a variable and sent it to flash. i probably will be using an array to store the values of "item1" but what can i use to create multiple param with the same name and have multiple values?
I don't really want to have any arrays like item1 = x,y,z because x,y and z are going to be html encoded, and the code of line would become enormusly confusing to read and edit.
View 1 Replies
Sep 20, 2009
How doe I pass a variable to Flash? For example, I have a link, [URL] How do I grab this variable, "about" in Flash?
View 1 Replies
May 7, 2010
How can i pass user input Varibles from Flash to Php?
View 6 Replies
Apr 5, 2011
I have a flash map I have created years ago and I've recently done an update to the file and published it. Everything works perfectly locally and online except for when I pass variables into the movie online none of the variables are recognised. Locally the file works fine and the dummy variables are passed in. But even online the dummy fall back variables don't work.There are two files the main map movie and the preloader. The preloader determines the variables that are passed into the main movie from the html embed code.HTML EMBED CODE
Code:
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="/media/flash/preloader-R10.swf?ShopLevel=<%= Request("ShopLevel")
[code].....
View 0 Replies
Nov 19, 2011
I have written the code for passing the variable from a php file to flash.Below is my php code:
<?php
$comment = "abcd";
echo "values=$comment";
>
Actually I can successfully pass the variable from php to my flash file. However, when I change the value "abcd" t
View 2 Replies
Nov 21, 2011
I am writing the codes that can pass the value from the table of database when I click on a button. When I click on the button in the first time, I send the the number of click: clickNum = 1 to the php file and I want to select the first row from the table. When I click on the button in the second time, I send the clickNum = 2 to the php file and I want to select the second row from the table, and so on. I can successfully send the clickNum in that numerical order. However, I can't pass the corresponding row of result back to the flash. For example, when I send clickNum = 1, it pass the value of the second row of table back to flash, but not the first row. And the row that it pass back to flash is different everytime, seems it is random and I can't find a pattern. The second question is that I still can't read the chinese character from the table of database even I have included the header("Content-Type:text/html; charset=utf-8"); in the php file.[code]
View 8 Replies
Mar 10, 2005
I am trying to pass a variable in Flash(MX2004) but struggling with it [code]where 'main' is a movie clip which conatins a variable called 'texts' to show the text entered in the html.
View 3 Replies
Nov 6, 2005
I have been reading all the post on this topic, but i just do not seem to get it! I am trying to send the variable "folder" to a flash file and get the flash file to recognize it. i am using the loadVariables() command to get the variable, but i am not sure how to process it to where i can use the variable later in the actionscript. can someone post an example script to show how to process a variable sent from php to flash?
View 1 Replies
May 19, 2009
what i'm trying to do is to pass a value to a flash from html page....(from html to_nameSWFVariable)following is my code :in html :
PHP Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab
[code].....
View 2 Replies
Jul 29, 2009
Need to get a flash banner to carry through PHP session download. The PHP code is below;
<a href="http://download.site.com/viperML/site/download.asp?file_name=site.exe&ul=<?php echo $_SESSION['language']; ?>&lang=<?php echo $_SESSION['language']; ?>&banner_tag=<?php echo $_SESSION['btag']; ?>">
The above carries through the affiliate ID together with Site Language which user has come to. The above works fine, what I need to now do is have my flash button call the same function...
View 3 Replies
Nov 23, 2011
I am trying to place a SWF on a page and pass a variable to it. The variable would depend on which link that the user clicked on. I am toggling the visibility of the div containing the SWF (code at the bottom). What I need to do is, when I toggle the div 'on' I need to pass a variable to the SWF so that it knows which file to load. Would I use SWFObject for this?Here is the HTML code on the page.
Code:
<a class="popUpLink" href="#" onclick="showHidePUP();">Trojan Horse</a>
<div id="boxPup" class="box" style="left:225px;top:75px;"><!--style="left:400px;top:150px;--
[code].....
View 1 Replies
Oct 20, 2009
I am using Flash CS4, as2.0
flash code:
code:
lv = new LoadVars();
lv.load ("miphp.php");
[Code]....
The output should be "anything" but instead of that, the output is ".$nombre."
View 2 Replies
Mar 10, 2005
I am trying to pass a variable in Flash(MX2004) but struggling with it.This is my code in html:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub...ersion=7,0,0,0" width="550" height="400" id="dtext" align="middle">[code]....
where 'main' is a movie clip which conatins a variable called 'texts' to show the text entered in the html.
View 3 Replies
Oct 14, 2010
I am trying to send a twitter update when I press a button in flash. I get the twitter page to open from the flash file but when it passes the variables, it is passing it as the following into the browser address bar [URL] and on the twitter page text box it shows [URL]. The browser is rendering the percent sign and the number 20 as actual text and not as the space that I need it to.
Here is my code
function onTwitterButtonClick(evt:MouseEvent):void{
trace("Twitter button clicked");
var twitterShareURLPart1:String = "[URL]"
var shareUrl:String = "[URL]"+youtubeVidID;
var twitterShareURLPart2:String = "&text="
var escapedText1:String = encodeURIComponent("Check out this latest video from Me");
var gotoURL:URLRequest = new URLRequest (twitterShareURLPart1 + shareUrl + twitterShareURLPart2+escapedText1);
navigateToURL(gotoURL,"_blank");
trace(twitterShareURLPart1 + shareUrl + twitterShareURLPart2 + escapedText1);
}
View 1 Replies
Aug 12, 2009
I've been having some trouble lately trying to get my flash movie to load variables being set in an aspx page, I'm new to asp and flash so I have a lot working against me.Here is the aspx onload code:
Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim tnumber As String = ""
[code]....
View 5 Replies
Oct 16, 2010
Well I just have to pass variables from flash to php then back from php to flash I've used the following sintax thousands times but now it has decided not to work any longer.
AS3 code:
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.MouseEvent;
import flash.net.URLRequestMethod;
import flash.net.URLLoaderDataFormat;
[Code] .....
View 1 Replies
Jan 9, 2012
I don't get it Why is it so difficult to pass a variable from Captivate 5 to AS3/Flash CS5. I have a variable (gpDone = 1) in Captivate 5 (it's a guided practice) on the last frame which will indicate that the learner has completed the guided practice file. Now I want to pass that variable back to Flash/AS3 so I can evaluate whether I should show the Continue button so they can continue. They have to complete the guided practice before they can continue. If it is equal to 1, the Continue button will display. If it is not equal to 1, the Continue button will not display, but a message will display telling them they have to complete the guided practice in order to continue in the course.
View 0 Replies
Jun 20, 2005
I found an old thread which showed how to get javascript to send flash a variable obtained from the URL which loads it's html page [URL].. It works a treat in Firefox but for some reason in IE it doesn't show the swf file it merely shows a white box where the swf should be and a scrollbar next to it.
[Code]...
View 2 Replies
Jun 11, 2007
Does anyone know a 100% secure way to transfer a variable from Flash to PHP. I have a SSL on my site, but I've been told that using the loadvars cmd is about as unsecure as you can get, even if your page is secure.One of the suggestions was Flash Remoting, can anyone confirm that this is a safe way to send a secure variable?
View 2 Replies
May 5, 2010
how to pass a variable from FLASH to PHP?I'm trying to upload an image through the URLRequest and pass a unique name for each file.( I want to store the name elsewhere and need flash to know the name of the file.)
Since I'm using the request.data for the ByteArray of the image, I read that I can't use the URLVariables to pass any other variables.
It is almost working, except for the filename.AS3 function calling the request and query string:
Code:
function uploadTheImage(GuidName:String):void
{
//create image
var stage_snapshot:BitmapData = new BitmapData(imgprev.width, imgprev.height);
stage_snapshot.draw(imgprev);
[code]....
View 1 Replies
Mar 23, 2011
i'm referencing variable names and object names dynamically such as:[code]i have 5 balls (insert joke here) which get all the same functions etc so i wanted a way to avoid making 5x functions to handle each one of the balls. Now one function can handle all 5, etc.what i can't figure out is how to use this same set up to reference a variable or object name inside another movieclip. if i have another movieclip named "myParent" for example, i thought i could refer to it with:[code]but this doesn't work.
View 5 Replies