ActionScript 1/2 :: Dynamic Image Actions On Swf?
Sep 20, 2010Does anyone works on loading image and; resize and move that image on swf?
View 3 RepliesDoes anyone works on loading image and; resize and move that image on swf?
View 3 RepliesI know that you can do for example onClipEvent(enterFrame) as an action for an exisiting movie clip.How do i dynamically do thisI load the movie:
_root.createEmptyMovieClip("myMovieClip", 101);
myMovieClip._x=50;
myMovieClip._y=50;
[code].....
Can u put actions on dynamic text?????
P.S. Im a n00b at actoinscript and will happily accept tutorials
I have a website that I'm creating an events page for. The intent is to have the text updated dynamically and the ability to create links in the .txt file that start a gallery in flash in a UILoader. The way I have it right now is that the links open a new page, I need to be able to link to the UILoader and specify a certain gallery to show up.I looked everywhere but I can't seem to understand how to do it. I saw that there was asfucntion but as I saw it's no longer in AC3.Here is the link to the page: go to the events page and you'll see what I currently have. The text on the left is dynamic from a txt file this is the content of the file:[code]I need to change the href to something that will trigger flash to load a specific gallery. I have the UILoader in there now and it gets the file that I need. But it's missing the point all together of being dynamic.I could create a function that gets triggered by the href but I've tried it and don't seem to make it work. I'm no programmer I'm a designer, so this is a little over my head. I've just cracked the door on AC3 when I started this website last week & I feel that I've came a long way, but there is a whole lot more learning to do .
View 1 RepliesAssign actions for a mc created dynamically?
View 3 RepliesI am using Flash5 to build a site. I have a main page with navigation bar to get around. The word "menu" is sitting on the right of the stage which contains the actions:
on(press) {
gotoandplay("expand")
}
which opens the nav bar on the bottom of screen. This works fine. However, the text was blurry on my site, so I switched the text from static to dynamic text, which solved the blurriness problem.
BUT, after switching the text, I discovered my "menu' button is not behaving as before.
Can one assign actions to dynamic text? If not, what do I do to still have legible text? Again, the menu bar and other links were working fine, but when switched to dynamic text, none of the navigation works.
I have a script; what it does is is read a numeric variable (projects) from "text.txt" and dynamically attaches a relevant number of movie clips in a row. Each one of these movie clips serves as a simple two frame "button"; frame one is the unselected state, and frame two is the selected state...
// load external data
loadData = new LoadVars();
loadData.onLoad = function() {[code]....
anyway, this script works just fine, as is. the variable reads in perfectly, the movie clips attach etc. my problem is this: I want the button that I click to go to its active state. this is no problem as all I have to do is add an onRelease/gotoAndStop() command which is attributed to each button as it is created, as above. my problem is that, say I had a bunch of dynamically generated buttons, when I click one of these buttons I don't know how to tell the other buttons to revert to their inactive states i.e: return to their first frames.
[code]When I run the file the image appears but isn't clickable.The full code is below.[code]
View 3 RepliesI'm having a problem with dynamically giving actions to buttons. This code, contained within another button, calls the function(s):
Code:
on (press) {
initSection("faces");
[code].....
I have 4 objects in the library. I use a switch case statement to randomly generate them to the stage;[code]When the user clicks "taskMC", I want to assign behaviors according to which object. If I trace "taskMC" I get the name (object A_Graphic, object B_Graphic etc.)but I can't assign actions to them that way. How do I get object A_Graphic to do one thing, object B_Graphic another thing...?
View 2 RepliesI'm generating movieclips based off of an xml file. The images load fine but I can't figure out how to target them for onPress actions.
[Code]...
I made a simple test Air application to try different approaches to masking or using hitArea to ignore mouse events over transparent areas of a PNG. Can't seem to find the right mix of things to make it work, nor could I find a succinct example on the web.Clicking on the transparent areas of any of these methods don't result in the click getting handled by the background.Here's the code I have:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" [code].......
I got four buttons that pull up images in a slide show. I want the fourth button to first pull the image in place and THEN shut down the movie clip. I thought this would be easy, but no. Unfortunately I canīt attach the fla-file on this forum. You could take a look at this:
[Code]...
It works in a sense. The movie falls into place when I click the button and the movie quits when I move the cursor. But it also means you might shut down the slide show involuntary when you move the cursor going for any of the other buttons. What can I do? I could point out that I'm not working with any frames here.
I have a series of frames one the timeline. Each frame has a graphic and a mouse click leads to the next frame. Think Myst.
[Code]...
When the middle frame is returned to, clicks no longer change anything. I believe that the actions of the 'left' frame are replacing the one's in the middle frame so then it is told to gotoAndStop to itself.
I'd like to know if that is indeed what is happening and how I can make it stop.
1. Can i put another set of actions in frame 2 of the actions layer?i tested but it doesn't seem to work..it has 836 rows of code and it's getting annoying when tryin to search for a function..
2. I am not that familiar with classes, i usually put all the code into movieclips or in actions layer.. i am not sure if i can call a function from a actionscript class..
3.I am curios if there is any way i could specify an alternative for the if statement like in this pseudocode:
if ( apple is not clean BUT is tasty)
{
eat(apple)
}
I have 5 buttons that need to, when clicked fade the image in the background out and fade a new picture in. each of these buttons has a specific image related to it. how can i achive this smooth transition in and out for all of the buttons?
View 1 RepliesI have a MC called image_mc. When I load an image from XML, I want the centre of the image to be over the MC.Here is my code which isn't working. Currently, it positions the top left of the image at the MC regardless if the image is portrait or landscape.
Code:
pic = portfolioTag.childNodes[num].attributes.IMAGE;
// LOAD IN FIRST PICTURE IN XML FILE, first occurance of IMAGE NODE[code]....
I want to make a flash movie which will load image and its hyperlink dynamically from external source. I know this is very common over the internet and as per some of the tutor I've done loading the image part but not able to sort out how to hyperlink that Below is the code
Code:
myData = new LoadVars()
myData.load("anastasio.txt")
myData.onLoad = function(succes)
{
[code]....
The text file "anastasio.txt" just have this line "image=photo.jpg". "holder_mc" is a blank movie clip. The image is loading properly but I dont know how to hyperlink that!! Can any one let me know how to do that dynamically.
Also, this is a very simple way of loading the image from text file but in real this will come from DB. The Admin will insert the image name and the url in DB and uploads the image to a specific folder from where the flash will load that image. I'm thinking what could be a better way from below to do the above stated task:
1) On insertion into DB, I need to create an XML file from DB fetching the image name and url and writing them to XML file. And every time the flash will load these from XML file instead of connecting to DB server.
2) No XML file. The flash will communicate with a PhP page which will fetch the records from DB and give it to flash for loading
I know both the ways for loading data into flash i.e. from XML or DB. I just wanted to know which could be the best!! In my opinion, XML file would be a better option since no DB connectivity every time on website but there will be only one record at a time which will get changed once in every month which is preventing me from creating XML file for just 1 record!!!
I have been trying to figure out how to create this movieclipI have a bunch of images which is laid out horizontally (x axis). The functionality is very simple, when I click on the movieclip it will allow me to drag it from right to left and vice versa. This part is simple enough. I face a problem when it comes to the end and the beginning of the movieclip. How do I make it undraggable when it reaches the end of the movie clip and vice versa when I drag it back to the beginning.
View 6 RepliesTrying to make a dynamic gallery that pulls images (along with names and dimensions) from different folders on the server. Want clients to be able to drop new images into these folders and have them pulled into the gallery dynamically. Do I need to use PHP as I did with AS2? or can AS3 pull the image names and dimensions from the folders on the server?
View 9 RepliesI'm a totally new bee in Flash scripting. I want to make a flash movie which will load image and its hyperlink dynamically from external source. I know this is very common over the internet and as per some of the tutor I've done loading the image part but not able to sort out how to hyperlink that Below is the code
Code:
myData = new LoadVars()
myData.load("anastasio.txt")
myData.onLoad = function(succes)
{
if(succes)
[Code]..
2) No XML file. The flash will communicate with a PhP page which will fetch the records from DB and give it to flash for loading
I know both the ways for loading data into flash i.e. from XML or DB. I just wanted to know which could be the best!! In my opinion, XML file would be a better option since no DB connectivity every time on website but there will be only one record at a time which will get changed once in every month which is preventing me from creating XML file for just 1 record!
My client has supplied a Flash template that I'm modifying in CS5 Pro. The text is feed from a XML file which I've figured out change to my requirements but I can't figure out to place an image in the text box which is a Dynamic text and have the text wrap around this image.
View 1 RepliesI want to set different locations in an Image, and when I mouse over the location it needs to shows something('box' or 'x' nd 'y' position of the location). How can i achieve this.?
View 3 RepliesI am creating an image dynamically on flex. This images changes (as in changes image source) when the user clicks on it. Images are PNG format and I replace it with this code:
img.source = PATH_TO_IMAGE;
The problem with this is when I replace the image is it is not smooth even if you set the image property to smoothBitmapContent.
Is there a way to smoothen images when you are trying to replace the source?
Need to:1) Create bytearray from BitmapData in Flex2) Pass this bytearray (or maybe converted to string with b64) to php script3) Convert this bytearray again to image in PHP and show it.
View 1 RepliesI am using Flash 8. For the site I planned to use dynamic text boxes for each page so my client can update the pages. There is no text, just an image.
Go to: [URL] After the intro, click on Featured Listings, Buyers Needs or Bio & References.
The image is distorted. Also, for some reason the dynamic text box is about 350px and the image size displayed needs to be 525 to fit correctly.
Here is the action script I used:
myData = new LoadVars();
myData.onLoad = function(){
myText_txt1.htmlText = this.content;
[Code].....
I have a flash file that is pulling images in dynamically from a PHP page. The images will come in all different sizes so I need to resize them once they are loaded to fit in the containers that they are being loaded into...I thought onEnterFrame was the best way to do this? So I have the following:
Code:
onEnterFrame = function (){
for (i = 0; i < 9; i++){
[code].....
1.I am doing a spinning wheel game, where the user gets 3 spins. After each spin, an image will display at the top of the wheel - of what they have won. At the end of the 3 spins they can then choose what they would like from the 3.Now, how can you display image like this? Would it be a 'Graphic' symbol or a 'Button' if it's a button (which i believe is the case) how can you display an image. In the code hint doesn't seem to be a parameter that you can edit to change a source.
2.I'm using Flash CS5 Pro, and i notice on a Lynda.com video that he goes to 'View->Simulate Download'. Mine doesn't have this, just before i publish would like to do a preloader but my version doesn't seem capable of doing it.
3.I was asked during work to make a form before my game starts, i'm wary about making significant edits like this because scared will break it.Is it easy/safe to insert a frame before it happens?
4. I have an EnterFrame event and it seems to play over and over again - as if it's on a loop, is this normal?
5. I have tried to publish my swf as html, but my movie would go from 1 dot aligned in the middle to 5, and back to 1 again.. like a preloader.. but it would never start.
Does anyone works on loading image and; resize and move that image on swf?
View 3 RepliesMy question is related to putting a border around an image. I am dynamically loading images from an xml file and they appear as thumbnails. I want to put a 1 or 2 pixel black border around the image when I load it. The problem that I see is that some of the images are portrait and others, landscape. I hope there is a way to do this in AS? I have searched the forum but nothing.
View 3 Replies