ActionScript 3.0 :: Class To Create Either A Sprite Or Clip That Consists Of An Image And Some Text Based On The XML Data?
Jul 3, 2009
I want a class that I'm going to pass a short bit of XML data And then I want that class to create either a Sprite or Clip that consists of an image and some text based on the XML data Example my XML might look like
<root>
<image url="whatever.com/image.jpg">
<name data="Blanius">
</root>
I know how to get to the data what I'm looking for is the best way to create this Sprite on my stage.should the class create a sprite or clip?should the class called to create an instance and then I addChild in my core script?
View 5 Replies
Similar Posts:
Jul 18, 2009
I am trying to create a custom component in flex that consists of a Button, and a TileList directly below that button. On button click event the TileList should open/close. The component works fine, but when I add it to my main flex app, inside a VBox, it simply opens and closes within the VBox. Because the height of the VBox is much smaller than the custom component's TileList, it causes scrollbars. My issue with it is that it should behave like a ComboBox/Pull-down menu and go over the VBox, instead of going inside it. how to overlay the custom component, so it behaves like a ComboBox/Pull-down?
View 1 Replies
Feb 19, 2011
I'm trying to create a simple interactive animation for a website that consists of three rollover areas on a page. When you mouse over an area, a bit of explanatory text is revealed by animating a mask over some text. The text is left displayed until a mouseover of a different area occurs.Let's call the three mouseover targets A, B, and C.A MOUSE_OVER event listener is registered for all three targets. In the event handler for each, I'm following a pattern like this:
Code:
A.transform.colorTransform = highlighted;
B.transform.colorTransform = notHighlighted;
[code].....
View 2 Replies
Nov 11, 2009
I got a flash file which reads xml data and based on total data I need to duplicate movie clips and show them horizontally. Till now i have read the data and displayed it but dont have idea how to display them horizontally.
Code:
i = 0;
level = 100;[code]....
I have done this till now, it duplicates the movie clip but when i want it to change its x coordinate it shows error
**Error** Symbol=mc_contentHolder, layer=Action, frame=1, Line 20: There is no property with the name 'x'.
newClip.x = 328;
Total ActionScript Errors: 1, Reported Errors: 1
View 7 Replies
Apr 8, 2011
I need to figure out how to create a flash based "widget? where I can pull in and display basic local airport data, like Delay information.
View 1 Replies
Feb 12, 2009
I'm new to FLEX.I've a requirement where i do have to load the data into Class Based Model(VO) from an Employee.xml which has got employeeName,departmentName,address & projectId tags.
View 0 Replies
Jan 8, 2009
I need to create an image gallery, based on an XML file, which displays both the thumbnails and the normal-sized images. Here's a link for you to get an idea of pretty much what I want to achieve, except for the fact that I don't want the thumbnails to slide to the left or right, I'd rather want them to be static, and if there are more thumbnails than, let's say 3, to display a "previous-next" controller. After following some tutorials, here's what I created so far:(you can also find all these files + the thumbnails in the attachment)The XML file (settings.xml):
PHP Code:
<slideshow>
<images>
<thumb tLink="th/01.jpg" desc="This is the first thumbnail" bLink="bigImgs/01b.jpg" />
<thumb tLink="th/02.jpg" desc="This is the second thumbnail" bLink="bigImgs/02b.jpg" />
[code]....
So far, so good, the script does trace what I told it to But I need to further improve this rather simple script. So, basically here's what I need:How do I load each thumbnail into a "container" movieclip, so I can further manipulate this movieclip's properties (do an easing for position, alpha, filters etc.)? There's one more thing I need to specify: I want to display only, let's say, 3 thumbnails at runtime, not all of them. how could I assign an instance name to each of them.
View 3 Replies
Sep 10, 2011
How to create the dynamic text box based on the length of the some text
View 1 Replies
Nov 1, 2010
I have a string variable, and based on the value of that variable, I want to create an instance of a class, I can do that with this code:
Code:
var boxType:String = "BigBox";
switch(boxType)
{
[code]....
View 3 Replies
Jul 14, 2010
Is there anyway to take take a "screenshot", "save" or "capture" the active SWF element on a page as an image? I'd like for users to be able to simply click a button on my page, instead of having to need to manually take a screenshot of the entire page and then crop the image to show only the SWF element.I found a Jquery method, although I am unsure if it could work with SWF files. It basically captures an area of an Image element on the page and allows you to save that as a separate image. What I would need however, is to capture the SWF as the image instead. Note: I do not have access to the SWF code so I cannot achieve this using Actionscript or anything like that
View 2 Replies
Apr 30, 2007
I have seen many tutorials on how to create xml-driven, thumbnail-based image galleries, but I am looking for one which can do a "Before and After" photo effect. I'm designing a realtor's website and want a "before and after" gallery to show work being done on some homes, before construction and after construction. So, basically, you have two photos, same size, overlaying each other, and use maybe an Alpha fade to "merge one photo into another"? Something which slowly fades one into another, not just something which does a complete Alpha fade out, then a complete Alpha fade in.
View 4 Replies
Mar 20, 2005
i wrote a bit of actionscript to dynamically create an image gallery based on how many images are in a given directory. as of now, i've got it to display thumbnails in rows. my next step would be to get these thumbnails to link to the fullsize images, but i cant figure out how to do that. my code is as follows:
[Code]...
View 7 Replies
Jan 28, 2010
the idea is to create a loop to that displays 16 cards face down in two rows and eight columns using either a "for" loop or "while" loop, execute 16 times once for each clip.use new to dynamically create card instances based on the Movie Clip symbol in the library.use a modulo operator to operate the x position of each clip use Math.floor to operate the y position of each clip set dynamic text value of the card clip to show appropriate card number add card to the display list if using the iteration variable ("while" loop).this is what i am using and i get one card (the stack of 16) in the bottom left hand corner with a 16 trace statements of "instance 2"
//create variable for number of columns
var numberOfColumns=8;
// requirement 1
[code]....
View 9 Replies
Aug 11, 2010
Is there a way to add text programmatically in as3 to a Sprite or a MovieClip without using the class TextField
TextField inherits from InteractiveObject which is kind of heavy for what I want to do: just display text (i.e. I don't want to interact with the text).
Note: I'm aware that there is a property selectable to make the textfield not selectable. This is not the point.
View 1 Replies
Aug 25, 2009
I'm building a project for a gaming website and i have an interesting dilemma. How do i make the font color change based on the data loaded from the external .txt file.
Example:
In text files i could have... yes yes yes no no maybe yes no. If the text says yes i would like for the font to change to green, if no to red, or maybe to orange/yellowish.
So basically if i went in and changed the No to a Yes on a .txt file, the next time i viewed that flash section the yes text would be in green instead of the default set by the flash core itself.
I hope i am making sense. I don't even know how to go about starting and i stared at the actionscript list for awhile to no avail.
View 2 Replies
Jun 11, 2010
Imagine I want a user to be able to copy-paste a selection of pixels from MSPaint into a browser-based app. Is this possible using JavaScript in any current browsers? Will it become possible in HTML5?If not, is it feasible using something like Flex/Silverlight, or is it simply not possible at this time, and you'd have to save a file and manually upload it?
update: sounds like HTML5 should allow it, but that's a way in the future to be genuinely useful. Some suggestions of Java applets and Flash are mentioned, probably Flash would be preferable since parts of the web-client would probably use Flex anyway... I'd rather not have requirement for Java and Flash in my site.
View 1 Replies
Mar 5, 2010
I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.
What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.
package {
import flash.display.*;
public class ScrollBar extends Sprite {[code].....
View 1 Replies
Jul 22, 2009
I have an interface that will have a variable amount of buttons in it and the text on each button can be anywhere from 10 characters to 30 characters. What I'd like to do is to have my buttons auto-size width wise based on the length of the text. I don't think that will be too difficult but I'd also like to have rounded corners on the top of the buttons so that they'll look like tabs and from my experience when you change the width of these buttons that have rounded corners they start looking a bit odd since they won't retain their original radius
View 2 Replies
Jul 25, 2009
I've done my fair bit of HTML coding and work fairly well with CSS but i've never ever done a mouseover in flash.. Now, the website's text, all of it, is simply located on a text.txt file that the flash file reads and incorporates onto the website.. All text and images come from this text file. This is what I want to do.
Click on Enter site, then when it loads, click on the "Selling" tab at the top of the site. On the "My Listings" section is where I want to have the mouseover text and the "Market Analytics" section (which we'll be renaming) is where we'd like the image to actually appear. My question to you is can this be done within this environment and how so?
I can edit JavaScript somewhat, though its been a while.
View 6 Replies
May 26, 2010
I'm using a tweening engine and I need to be able to base the _yscale % of a movie clip off the height of a dynamic text field that is slightly smaller contained within the movie clip. 52 pixels smaller to be exact.I'm very poor at math but I'm guessing so far that some variable needs to be declared to factor the percentage based off the height of the dynamic text field. And I just can't think of how to do that.What I know so far:movie clip height at 100% _yscale = 396 the 'buffer' space above and below the dynamic field = 52.So if my dynamic text field height = 0, my movie clip would be 52 pixels in height. And that percentage in _yscale is 13.1%.I just can't figure out the math for this and how to translate it into ActionScript.
View 2 Replies
Feb 25, 2010
I'm currently working in Flash mx 2004 and am creating a version of 'what happened in history today'. So my final layout will have the following iobjects.
Heading: 'current date'
Title: 'On this day in History'
Text box: Which displays the right description from a text file. history.txt
Image box: which displays a pic related to the current date.
I know basic Flash but have been playing around for ages am having real trouble getting things to work correctly. The main priority is to get the text loaded based on the current date. I have an images folderwhere the pictures are stored with files names related to date i.e. 14feb.jpg and my history.txt file is set out with a line for each date. i.e., 14feb=Valentines Day etc.
View 3 Replies
Jan 31, 2012
Is there any AS3 library or code-snippet that can create altered versions of a Sound object on-the-fly (at runtime)? Either based on:
An existing Sound object; A ByteArray object;
For example, say you have a "dry" sound of a gun-shot. You could:
[Code]...
View 1 Replies
Jun 9, 2011
create a class that delivers the a text format to a requesting class. Unfortunately, even though when I trace the return it comes back with [object TextFormat], I do not see the results of the formatting. Heres [part of the clas trying to use the txtformatting class:
ActionScript Code:
private function buildTF(msg:String = null):void {
with (_tfield) {
alpha = 1;
[Code].....
View 6 Replies
Nov 4, 2011
I just discovered impure.com and was very impressed by what can be achieved in terms of visualizing data using their workspace. Although the platform is free to use, but not open source yet. This causes a few problems because the API section works with .com sites for eg. for ebay, so I cannot visualize ebay listings for regional sites such as ebay.in because the link to ebay.com is hardcoded.I searched around, but didn't find other projects that offer a similar way to work with site APIs and other data sources with the kind of user interface and detail that impure.com does in a realtime way within a browser window.This brings me to the questions:
-What technologies would be involved in creating a similar kind of project
-What are the open source tools that can help develop a fullscreen UI to render the workspace. Are there any alternatives to flash for this, and how do they compare
The goal would be to use standard python data structures, python scripts to do some processing on these data structures, scripts to gather data from csv, json and API sources such as google yahoo, wikipedia and flickr, and scripts to render graphs, tag clouds, network visualizations etc. Then bring them all together into a visual interface that supports drag drop and simple type checking.How would the python backend integrate with the UI.
View 1 Replies
Jun 2, 2006
i got a doubt with creating XML objects using classes. thecase is:there should be a class like CreateXML which will intialisean XML objectand has methods to add new elements to the XML. how to createnew XMLelements/nodes to this class?is there anyway to create and write into an external XML fileusingactionscript?can we make an XML object updated with new data elements onthe runtime
View 1 Replies
Jan 15, 2012
I found something when I create bitmap data cache for each frame of a movie clip:I got a movie clip, instead of presenting it immediatly on stage, I created a bitmap data array to store each frame of it, so I'm doing:
var body:MovieClip; // some mc for body
var suit:MovieClip; // some mc for suit, frame count is the same as body mc
body["part"].addChild(suit); // it's a avatar, there's a sprite named "part" on body mc to contain suit mc
[Code]....
if i present the original body moive clip, everything is ok, but when I use cache, it begins to tremble, this is because the getBounds() method of movieclip returns different rectangle when mc is cached and mc is presented on stage. I tried trace out every getBounds() when caching and when Event.FRAME_CONSTRUCTED fire, they're different, making my cache crash!
I assum MovieClip class do not refresh until it's present to stage or some time in on frame, how can I get the real boundary of it if I need to cache it?
View 2 Replies
Jul 15, 2004
I currently have a class that has a method that creates new duplicates of a clip on the screen, changes some of their properties (such as color, and text display), and then arranges them in a straight column. Inside that method, I have some clipEvent Statements for each button.
[Code]...
View 4 Replies
Jan 11, 2011
I have a string of of base64-encoded PNG image that is suitable to use as a src (source) attribute in a <img> tag. However I need to transfer this image to Flash applet where I need to create (show) the image fast. Is there a way to simply use the data string and somehow create an image (inside a Flash movie) from it?
View 1 Replies
Jul 20, 2011
So I'm working on my portfolio and I got this problem. The code posted scrolls the sprite "cellContainer" based on the position of stage.mouseY. Perfect.Problem is that I want stage.mouseY to equal the entire cellContainer height. Kind of like how a small tablet equals a huge monitor. So when stage.mouseY = 0,cellContainer.y = 0 and when stage.mouseY = stage.stageHeight, cellContainer.y = stage.stageHeight - cellContainer.height. Right now, it scrolls, but it takes a while to scroll throught the entire height of cellContainer. I want it to be proportional to stage.mouseY.
Actionscript Code:
private function scrollStart(e:Event)[code]....
View 4 Replies
Oct 18, 2007
I need text to be displayed with some movie clips or smileys with it in dynamic text box. Like the below but when i tried to do this i am getting some thing like this it is registering with left or right only. how to rectify it? I am using html output for attaching the clip with text for output
View 4 Replies