ActionScript 3.0 :: GetDefinitionByName For Embedded Swf Symbol Not Recognized As Image.source When In Loop
Jul 19, 2010
I'm doing this in Flex, but code is pure actionscript, so if it's not the right forum please let me know:)I've embedded swf symbols like this:[code]but this code throws an exeption that 'myVar0 is not defined'. However this code:[code]
View 4 Replies
Similar Posts:
Nov 11, 2011
I bought Flash recently and I'm getting started on making a game, a platform shooter game, thing. What I have, is a button on the main stage that I want to activate a function in an instance. But that instance is inside a symbol. So it's Stage->Character->Gun. But if I put down:
Shoot.addEventListener(MouseEvent.MOUSE_DOWN, Fire);
//Shoot is the button on the stage
function Fire(evt:MouseEvent):void{
Derp(); //This being the function I want to be activated
}
This is the code in the Gun instance:
function Derp():void{
//epic code goes here
}
It will give me an error saying "1180: Call to a possibly undefined method Derp." So basically it's telling me it can't get to this code because it's not on the same stage. How can I get an instance to be recognized by all code in my project, regardless of we're it is in the project? I want to keep all my symbols where they are, so external ActionScript file won't be good if I have to recreate the object on the stage.
View 3 Replies
Oct 23, 2007
Say I have "Symbol 1" in FLA document "DocOne". I drag this symbol from DocOne's library into "DocTwo"'s library. Now, in DocTwo's library, the properties for Symbol 1 show that the source is "DocOne". I can use the symbol update functionality to update it from DocOne. Is there a way to sever this linkage so that Symbol 1 in DocTwo no longer considers Symbol 1 from DocOne to be its source? So that, for example, if I drag it over from DocTwo to DocThree, Symbol 1 in DocThree, its source in DocThree will be DocTwo and not DocOne?
View 3 Replies
Jul 15, 2010
I've got a number of related projects set up in Flash Builder. Each project gets its graphical assets from an exported SWC file (or multiple SWC files.) This works fine, but I wanted to create a shared project that contains stuff used across all projects. The first item in there is a screen with a number of clips containing dynamic text fields on them. This screen (and associated assets) are exported to a SWC and then I have written code in the shared project to add functionality to the screen and buttons. I'm using 2 fonts, both are embedded.
Both show up just fine in my test harness, but when I link the shared SWC and src folder (which is required in order to use this code/assets in the other projects) the textfields blank out if I try to set their text properties. If I leave the default text (set in the FLA) it shows up, and the static text fields in the FLA also show up, it's only when I set the text property.
I've tried a number of combinations, including removing embedding, exporting for ActionScript, setting all textfields in the shared project to dynamic, all with no luck. The main project does have the same font embedded, and I've checked that the same glyphs are selected in both the main and shared projects. I realize this is a rather complicated setup, but I have yet to find a workflow to allow a designer and developer to work on large projects that is better (but I'd love to hear one!)
View 2 Replies
Jan 2, 2010
i am creating a survey with say 7 questions. each question has the same MovieClip symbol each with a different instance name, like q1, q2, ... q7.
the MovieClip symbol has 5 static texts and 5 SimpleButtons. i have some code in that symbol to make sure that only a single button has the "on" or "checked" state to show that that one is chosen. this works great.
my question is, how do i communicate each user choice with the main timeline after the user hits the "submit" button? or, how do i have code under the "submit" mousedown event that can iterate through the 7 symbols to query each one and see which of the 5 SimpleButtons is "checked" or "on". this iteration will then create a list of responses for all 7 questions.
ultimately, i will have flash concatenate a GET POST string that will send the survey results to a web server.
View 4 Replies
Feb 8, 2012
I am trying to create a dynamic class from a symbol in an embedded swf, basically I need to be able to add arbitrarily named properties for some exciting math, but it appears the only way is to create a dynamic class.
[Bindable]
[Embed(source='ExternalAssets/Assets.swf', symbol="assetName")]
private var AssetNameObject:Class;
[code].....
View 1 Replies
Jun 17, 2011
I am trying to download a heavy swf dynamically to my site using URLLoader class. I'd like to know if it is possible to use a symbol inside the swf as a separate object?[code]Embedding the swf increases the initial load time of my site and I want to make it dynamic. How can I access the Kungfu symbol from Fight.swf after it is downloaded using the URLLoader class?
View 2 Replies
Jan 25, 2012
I am changing image through flex every time i change it saved into server directory with same name(which i am referring to show). So when i refresh my page my browser didn't send new request to server since it's already in request.so didn't getting new image.Tip:- when i clear browser history it will come with new image
View 2 Replies
Dec 9, 2009
DISCLAIMER: relatively new to Flex/AS3, I might be missing something obvious. After doing some research it appears that using the for(var property:String in object) does not guarantee the enumeration order of properties, however it doesn't say anything about modifying the VALUE that property points to as changing the for...in loop.
[Code]...
As a solution I can create a temp object to store the data while doing the loop on the original object, and then replace the original object with the modified data, but I'd like to know what exactly is going on.
So my question is, does the value of object property modify the looping order of the for...in construct? And if so, should it or is this a bug?
View 3 Replies
Nov 22, 2010
I have created a component that I want to add to all of my panels that allows It works reasonably well.The last (hopefully) issue that I have is that I want to embed the image in the class. Doing this causes the click event not to fire.If I us"this.source='assets/info.png'" everything works OK. If however, I embed the image as shown below, the image displays, but is not clickable.
public class HelpIcon extends Image{
[
[
[code]....
View 1 Replies
Jun 19, 2009
Using CS3, I imported a flash vid to my library. I'm pulling the vid in and trying to get just the video to loop within the flash file. I've tried setting the properties to loop and it's just not working?
View 1 Replies
Jun 27, 2011
I just want to write a proper regex to get the source of the image from given html text.
//HTML TEXT: <img src="angry.gif" alt="Angry face" />
var regEx = //regex Here
var source:Object = regEx.exec(htmlText);
View 1 Replies
Sep 24, 2009
I am trying to run a for loop that will target MCs that are embedded in a parent mc... I keep running into issues with the targeting however when I try this:
for(var i:int = 0; i<5; i++){
parentClip_mc["m"+(i+1)+"_mc"].visible = false;
}
This dosnt seem to cut it. How should I go about this? This is the error that I get: TypeError: Error #1010: A term is undefined and has no properties.
View 2 Replies
May 30, 2010
I'm trying to loop an embedded mp3 but only on certain frames, labeled (TOC1, TOC2, and TOC3). I labeled fourth frame "test", but when it gets to this frame it continues to play.
Code:
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.MouseEvent;
[Code].....
View 7 Replies
Oct 27, 2009
I have an embedded 10-second video (of water ripples, for example) that I would like to loop continuously without displaying an obvious break/jump from the end frame to the first frame.The video itself does not end at the beginning, so it cannot simply be looped. The only way I can think of to simulate a seamless loop it to use the alpha/fade tween somehow, but I have no clue where to begin, or if this is even possible in flash. I just have these two theories:
THEORY #1:
If a movie clip can be reversed, then I can append a reversed copy of the clip on the end, which would create an actual seamless loop.
THEORY#2:
If I can cut the first 2 seconds of the clip, and paste it over the last 2 seconds of the clip, then fade in on the first one, this would create a virtual seamless loop.
Of course, I have no idea if these options are possible in Flash (I have CS3).
View 4 Replies
May 19, 2010
I have CS3.I encode my video with the Encoder, then I import it into Flash. From there, I cannot figure out how to make the embedded flv file to loop.
View 5 Replies
Apr 1, 2012
I have an flv video file that I've imported into Flash CS5 project as an embedded movie, because graphic and movie clip both produced still images. I want to embed the final product onto my website, and have the video autostart in the beginning, play all the way through, and then go back to frame 40 or so and loop continuosly from there. I've tried selecting the final frame and applying the instancename.gotoandplay (40); code but it isn't working. I read that this only works on keyframes, so I tried making the final frame a keyframe but because it is an flv file for some reason it isn't allowing me to do that.
View 2 Replies
Oct 27, 2009
I have a 10-second embedded video (of, say, water ripples) that I would like to loop continuously without displaying an obvious break/jump from the end frame to the first frame.The video itself does not end at the beginning, so it cannot simply be looped. The only way I can think of to simulate a seamless loop it to use the alpha/fade tween somehow, but I have no clue where to begin, or if this is even possible in flash. I just have these two theories:
THEORY #1: If a movie clip can be reversed, then I can append a reversed copy of the clip on the end, which would create an actual seamless loop.
THEORY#2: If I can cut the first 2 seconds of the clip, and paste it over the last 2 seconds of the clip, then fade in on the first one, this would create a virtual seamless loop.
View 1 Replies
Dec 26, 2011
1. When I make a symbol, I find the reference point always appear on the upper left corner, is there a way I can change the position of that?(besides use javascript?)
2. When I make a animated graphic Symbol, I drag into scene, it always repeat itself so I have to change the instance property to non-loop. Is there a preference which I can preset all the instance to non-loop?
3. if I make 2 animation character in 2 different flash file, how can I combine the 2 files but still keep the layer and key for each character?
View 6 Replies
Oct 1, 2009
I have imported a font into the Flash library in an FLA file this way in the New font symbol dialog box:
[Code]....
I'd like to assign this font to a TextFormat instance, but as you can see, something is wrong or missing. But what?
View 3 Replies
Mar 22, 2009
im trying to create a card game in flash.i have an array with all the cards. i then randomize the array and start pulling cards. each card was an imported image changed to a movieclip. i use this to load the cards:
holder1.attachMovie(myCardArray[0,0],"card1a",1);
where "holder1" is a movie clip symbol. so, i do this for all cards being deal on the table (holder1, holder2...holder4).everything seems to be working just fine. when the user clicks on the card i want to get the name of the movie clip symbol embedded in the "holder" (ie, get the name of the card that was clicked). how do i do this? oh, and im using actionscipt 2
View 1 Replies
Feb 16, 2010
I want to change the image at click event.I change the source of the image on click but its not reflecting immediately it comes when any other event is fired.
View 2 Replies
May 19, 2011
This works:
<mx:Image styleName="image" source="done.png">
</mx:Image>
This doesn't:
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
[Code]...
View 1 Replies
May 25, 2011
In Flex, how to assign swf as image source at runtime, not embedding it.[Bindable] public var myImg:String;<mx:Image id="intImg" source="{myImg}" width="96%" height="96%" />In my application, I fetch image url dynamically from a web service call, and assign it to "myImg". But until I don't get the response from the web service call, I want to show a loader swf in image control above. I assigned something like:myImg = "assets/AS3.swf";and the path of swf is correct, but it doesn't show up.UPDATE:The code I've shown above works perfectly in a Flex 3 app but the swf does not show up in a Flex 4 app. Is it because Image control has dropped the support for swf in Flex 4 ?
View 3 Replies
Jun 3, 2011
I have an image which its source depends on a bindable property of another object.I'd like to know when this source changes, for example, by capturing the bind event or another related event of the Image control.
View 1 Replies
Aug 25, 2011
I would like to display an Image using a Bitmap as source. I've looked at many websites and most suggest something akin to this but somehow it still doesn't work....img1 works fine... But img2 doesn't load for some reason.
private function onComplete(event:Event):void{
bytes = event.target.data;
img1.source = _bytes; /*this last bit works*/[code]....
View 1 Replies
Nov 16, 2011
I want to make a simple .swf file with an image. The source of the image is not fixed but dynamic. It should be a user's profile pic on facebook [URL]. I can get the user facebook id's dynamically with a php file that generates XML. How do I make the .swf extract the image source from the xml?
View 1 Replies
Dec 29, 2011
I have a class with a contstructor that should only change the source of an image.
[Bindable]
[Embed(source='../pictures/test.jpg')]
private var _picture:Class;
[code]....
(the image is not an image, but a class)The problem is that when I call the constructor, let's say:
var test:Test = new Test(pictureAtStage.source);
Flashbuilder will give an error, becouse I can't tell the compiler what data type "newSource" at the constructor will have...
*edit:When i use _picture.source, the embedded source does not seem to be changed...?
View 3 Replies
Jul 6, 2009
I did small flash where i exported layers from Photoshop and converted them into movieclips. currently i need to change they image source to other when i click on button.this one is required to make swf file smaller to load files after loading swf file itself. .
View 1 Replies
Sep 23, 2009
share with me a source of Simple XML image slideshow. I just want to see the method of loading pictures and switching between previos and next of the current one.
View 1 Replies