ActionScript 2.0 :: MX Adding A Picture In A Swf As A Variable?
Jun 23, 2010
Ive made a movie but i want to get someone to add a picture of themself in an swf (either through a browse button OR simple paste into a variable box) and it appear later in this electronic card im trying to make.
*edit* . . i dont what this to be done in the flash file, on the opening screen i want the user to locate a pic on their hard drive and then slave this picture througout the swf movie ive already created all the tuts im looking at seem to have the images already in the library and they are clicking buttons to display them, i DONT want this . .
I have an issue with Bitmap object. I have a photo gallery which I read from an XML file. Each photo has a path, id and description. When I'm adding the picture to the screen I am doing as follows:
[Code]...
My problem is that when I click the bitmap added to the container I must know what picture this is by getting an id. This way I know what gallery I am to open. A bitmap object does not have this property to be set (id and path). I have decided to create a class which extends Bitmap and then add these attributes within this class. So instead of using a bitmap I would use something like:
I want to make a picture gallery and use buttons that move you from picture to picture and backwards, but I don't want to tell button 1 to go to frame 2 and button 2 to got to frame 3 and so on (I hope you know what I mean)Can I use on button on a separate layer with the same action set? I tried something like that, but it didn't work:
on (release) { thisframe =+1 } [code]........
but it didn't work. I'm kind of new to any action script other than gotAndPlay, easy functions and all that.
I have what I think is a scoping issue with a listener. I have a movie clip which contains several picture management functions. I want to add a listener to it so that the next image loads before it is processed. Where do I put the listener - In the MC or in the root? At the moment, I have it in the MC but it does not run the function. I created a test function in the root which runs the listener no problem.
I've migrated from AS1 to AS3, and boy, a lot has changed... Anyhow, to learn and understand AS3, I'm modifying a slideshow I found through thetechlabs. I want it to play SWF as well as JPG. These files are passed through an XML file. I added an element called <delaytime> to the XML file that replaces the standard time a photo is shown in the slideshow.
I modified the onSlideFadeIn() function as follows:
function onSlideFadeIn():void { slideTimer.removeEventListener(TimerEvent.TIMER, nextSlide); slideTimer = new Timer(xmlSlideshow..file[intCurrentSlide].@time); slideTimer.addEventListener(TimerEvent.TIMER, nextSlide); if(bolPlaying && !slideTimer.running) slideTimer.start();}
However, when I run it, I get this error message:
## [Tweener] Error: [object Sprite] raised an error while executing the 'onComplete'handler. TypeError: Error #1010: A term is undefined and has no properties.at slideshow_fla::MainTimeline/onSlideFadeIn()at Function/http://adobe.com/AS3/2006/builtin::apply()at caurina.transitions::Tweener$/::updateTweenByIndex()at caurina.transitions::Tweener$/::updateTweens()at caurina.transitions::Tweener$/onEnterFrame()
It stops at the first picture of my slideshow. When I push the 'next' button it displays the next pic, but I get the same error message again.When I comment out this line:
slideTimer = new Timer(xmlSlideshow..file[intCurrentSlide].@time);
the slideshow runs OK, but without the delaytime specified in the XML file.
I have the following code: Can the following code: globals.data.goal = globals.data.player1/5 be converted to something like: globals.data.goal = globals.data.player(globals.data.clk)/5
I recently used the loadMovie action to load a .swf file to a target in the movie which it was being called from. Then I tried calling a picture to another target in the movie, but it did not load the picture as intended. I read about it on my book, but it didn't seem to work. Is there anyways on calling a picture into a target in the movie without placing the picture inside an swf file?
I have just been to a really nice website that has some really nice use of Flash on it.... I'm totally wowed by the resizing picture effect though? When each picture loads the loading frame resizes to the new picture size.
I am trying to build a site that would give users the ability to upload a picture to a picture frame on my site. I would like AS3 to dynamically re-size, and upload the file from an upload bar under the frame.
I'm totally wowed by the resizing picture effect though? When each picture loads the loading frame resizes to the new picture size.It must be some sort of actionscripting but how is it done?
I have a variable i that I'm setting to 5. i = 5. Simple enough, I have a dynamic box on the screen so I know that's working.
On the same screen, I have a button, that when you click it, it should do the function i = i + 1. I know this isn't working because when I click it, the number on the screen doesn't change.
Also I have a second button that is a collection of if/else if statements. Basically, if i=1, goto 10, else if i<1, goto 40, else if i>1, goto 40. I know that since I'm setting the initial value of i to 5, it's impossible for i to be equal to 1. Yet every time I click this button, I goto 10 even though i doesn't equal to 1.
im using PHP with MySQL to send information to my flash file using GETs.Using FlashVars i have managed to get the users 'id' with this i can send my questions/searches to a PHP script which access the database and returns the information to the html page.What i would like to do now is add the information sent back to the html page to a variable inside flash for example:
var usr_name = get_user_name(id) || 'Unknown'; // "Unknown" should just be for offline use.
but this just returns 'Unknown' this is the function used:
public function get_user_name(usr_id){ loadData('search.php',"quest=name",'usr_id='+usr_id); }[code]......
If i just type the URL into a web browser i get the name outputed.
Using AS 3.0 I have declared a variable on the main timeline var thescore:int=0; From within a movieclip I now want to increase the value of that variable and display it in a text box. var thescore:int=thescore+10; Object(root).myscore.text=thescore.toString(); The above code only displays ten and doesn't increase when the movieclip loops.
If I change the code to thescore=thescore+10; Object(root).myscore.text=thescore.toString(); I receive an error undefined property.
i got five images, and five buttons, every image has a color, and lets say we start at the red one. When i click the the green button i want the green image to fade in.. i fugured out a way to do this on the timeline, but then i have to have a black box first fading in to remove the old picture and then start fading in the new picture..
I made a simple picture slideshow with a timer, prev/next buttons, pause/play buttons and jump buttons. Everything went good so far.Now i'm trying make every picture go to a URL when the picture is clicked but only the link on the first frame goes to the URL when clicked the other 5 buttons do nothing when click.(FYI: I made alpha 0% buttons in a layer above pictures)I tried two different codes but both have no effect.
as layer
Code: stop(); var nextImage:Timer = new Timer(3000); nextImage.addEventListener(TimerEvent.TIMER,playNext); nextImage.start();
Basically, I have an input box on a widget that sends information via PHP.
One of the input boxes is phone number. Everyone inputs number as normal, but without the country code.
Is there a way of me taking their normal number from the input box, removing the '0' and adding the country code before sending it (i.e. within a calculation/function/formula).
I have the following working line: moveMC.y = twn.bounceBall01.y It successfully gets the y value of bounceBall within the MC twn, and applies it to the y value of moveMC. How do I replace the 01 in bounceBall with the following global variable: globals.data.clk? I've tried using a way that Ned successfully showed me for a different situation, plus tried some other permutations, but Flash says "no way dude".
The Code bellow is a simplified version of what I am trying to do. My actual code involves copying an item from one array to another (which I am able to do). Then displaying the contents of both arrays on the stage.
//blueCircle is a library object with proper linkage set up. var ball = new blueCircle(); ball.x=100;[code]....
When I run this code only 1 ball appears on the stage at (200,200).Is there another way to assign one value to another so that it will be duplicated rather then just adding a pointer to the original variable? if not is there a way to copy the instance of ball and add it to them memory location of another ball?I know that I could call:
var anotherBall= new blueCircle();
but this won't work for the application I am writing because the contents of the array I am trying to copy from are all different types of objects.
So basically I've got a MovieClip called Jug and when the egg is clicked and dragged to the Jug I want it to disappear and then re-add itself in the place it first started. Aswell as this I want a variable to be added by 1 in value. I have tried fiddling around with this for a while now and I can't figure it out since when I remove child it gets errors. Here's the code:
I've been trying to add quotation marks to a variable for the past hour or so, but I haven't been having much luck. Basically, here is what I am hoping to create:
Code: blarg = W71; temp = magic code that I can't figure out trace(temp); // displays "W71"
I stumbled on a previous case of this [URL], but that method didn't work for variables when I tried it. Adding a + symbol before and after blarg gave me an error.simple way to incorporate quotation marks around my variable?
I can't figure out what the syntax is for this in Actionscript. Basically, I have a variable I want to add into a string that will call a certain frame based on user's language selection.
I working on a flashbanner. It is a dynamic textfield called "regnr" where the user is supposed to add a registration number (of their car) before clicking the send button. This code is on the button:
It works when the domain is hardcoded but doesn't work when I am using the clickTag. Is it possible to add variables like this to a clickTag? How could this be done to actually work?
On my stage I have 5 items labeled item1_mc, item2_mc, item3_mc and so forth...they all have two keyframes on their respective timelines, one labeled "active" and the other "inactive". My code contains 2 arrays, inactiveArray and activeArray and a variable known as energy that regularly goes to and from 0 - 100.What I am looking to achieve is basically the function of...if energy >= "insert given items 'active threshold' 20, 40, 60, etc..." then add it to the activeArray, if it is not, remove it and add it to the inactive array.
all objects in activeArray gotoAndStop("active"); all objects in inactiveArray gotoAndStop("inactive");
I have tried many different ways of achieving this effect but I always end up with duplicates and extras or something doesn't move when it's supposed to, where it's supposed to, it just ends up into a giant cluttered mess and I start from scratch.
The portal in my game is suppose to be unlocked after you collect all the coins. The portal is locked but when I go over a coin it neither adds to the variable or removes the movie clip by instance name of coin1 coin2 and coin 3.also if the remove movie clip doesnt need _root I've already tried it without it I know that is not the problem.
var openportal = 0; function moveStuff() { //-Very long code that is working. [code]..........