ActionScript 3.0 :: Variable Losing/not Assigning Value?

Jul 26, 2010

I followed a dynamic gallery scrolling thumbs tutorial and then changed it quite a bit to fit my needs.

I basically added a previous and next button and image title box.

It all works great apart from one thing.

e.g. I click on thumb 5. I then use the next button and go to say... image15. I then click on thumb 9. When I use the prev or next button again it will resume from image15, but it should then carry on from thumb 9 as that was the last change I made.

I thought this would be as simple as assigning the thumb variable value to the image number variable. i.e myID = id; but it doesn't work. my variable myID actually loses its value when I click the thumb image (I used the trace to clarify).

Here is the code.

PHP Code:

function bttnClick(event:MouseEvent):void{
bttn.gotoAndStop(1);
root.logo.visible = false;
myID = id;

[Code].....

View 4 Replies


Similar Posts:


ActionScript 2.0 :: FMX - Assigning External Variable To A Local Variable

Sep 10, 2003

I have a LoadVars object called loadText in which an external variable is loaded from a text file. Now, the whole thing works, I just want to create a template to optimize the system, so here is what I need: The external variable (in an external text file) is called page1. I am assigning that external variable to a local variable (at this point the external text has already been loaded in loadText, of course):

[Code]...

View 2 Replies

ActionScript 3.0 :: Losing Variable Values Between Functions?

Nov 9, 2009

I'm trying to do something simple in actionscript as simple as this:- Create a variable: var urlVideo:String;- Use that variable inside a function and give it a value: urlVideo = ideoElemento.url.text();- Then create a new variable and give it the urlVideo value: var url:String = urlVideo;

Here's my code:
var idVideo:String = "12";
var urlVideo:String;

[code]....

View 14 Replies

Flex :: Prevent Variable From Losing State After Being Set?

Nov 4, 2009

I've hit a very strange issue in adobe flex and I'm not sure how to solve it. I have a popup box that is called on creationComplete before startup of my main application. The popup simply asks for an email address and then the application is enabled showing the email address in a label component.

However, when I try to access the email address from the label component called UserID.text in the application, it is always null even though it is visually present in the label box...It seems like it loses state somehow...so HOW in earth can I keep it from losing state? I need to access the label or some variable throughout the use of the application and everything I try always ends up in a null variable?The main part of the application that sets the label is here:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:controls="com.iwobanas.controls.*" xmlns:local="*" creationComplete="showWindow(true)">
private function showWindow(modal:Boolean):void

[code]....

View 1 Replies

ActionScript 3.0 :: Assigning XML Data To A Variable

Mar 23, 2009

Having a problem getting an mc to read variable data. URL...

View 1 Replies

ActionScript 3.0 :: Assigning Value To Variable From XML Data?

Sep 19, 2010

I have a problem which i hope some one can help me with. I am loading in data from an XML file. This works fine, i can trace the contents of the XML file. The problem i have is this. I want to save each attribute to a class variable so i can call upon it with a getter method.The code is below:

Code:
package XML
{
import flash.events.Event;
import flash.net.URLLoader;

[code]....

If i trace(path) inside the processXML() its displays as expected. but if i fire my getter method path() im returned a value of null.

View 6 Replies

ActionScript 3.0 :: Assigning Dynamic Variable Name?

Nov 15, 2011

I have a for loop - for (var i:int=0; i< results.length; i++)

and in this for loop a button is created - var multiplereportButton:Button = new Button();

I would like the integer value from i to be appended onto the name of the variable, so I thought this would work: var multiplereportButton + i:Button = new Button();

View 3 Replies

ActionScript 2.0 :: Assigning Variable Name To TextField

Jun 5, 2005

I've seen many times the following procedure to assign a variable name to a text field:
- We create a generic movieclip which contains a dynamic text field called "tittle" (for example)
- We add 4 instances of this movieclip to frame 1 in our main time line.
- We give them a different name (testMC1, testMC2, testMC3 and testMC4)
- We also add this little AS into frame 1:
testMC1.tittle = "Hello";
testMC2.tittle = "How";
testMC3.tittle = "are";
testMC4.tittle = "you";

If we run the fla we'll have the 4 movieclips on screen "Hello How are you". So far, it's ok, no problem and everything's understood. However I'm trying to implement a variation for this method which I need to use, but I'm not succeeding. I'd like to assign the variable values from a plain text file instead.

Hence, I create a plain text file called "Exampletext.txt". Inside this file I put the following variable values:
&variable1=Hello
&variable2=How
&variable3=are
&variable4=you

I add this piece of AS lo load the variables from the text file:
this.loadVariables ("Exampletext.txt");
And finally, I modify this bit too:
testMC1.tittle = variable1;
testMC2.tittle = variable2;
testMC3.tittle = variable3;
testMC4.tittle = variable4;
And well, it does not work at all!

View 5 Replies

ActionScript 2.0 :: Assigning Variable On Different Timeline?

May 7, 2011

I'm using Flash CS4 Professional. I'm new to Flash, taking an on-line college class, and we 've gotten to ActionScript. The entire second page of 'web site' is a movieclip. The mc includes 2 input text boxes and a button. Clicking the button is supposed to take the movie to page 3, a frame on the main timeline. Finally got that to work with 'with (_root) gotoAndPlay ("frame label")'. Page 3 contains 2 dynamic text boxes and I've tried several versions of _root and _parent dot syntax paths and tried 'with (_root)' but I cannot get values from the input boxes in the movieclip to show up in the dynamic boxes on the main timeline.

View 2 Replies

Actionscript :: Only Assigning A Piece Of String To Variable?

May 23, 2011

I have a XML document that I have to hard-code into AS (Yes, I HAVE to). I am trying to assign this xml to a string but for some reason on the xml doc declaration is assigned?[code]...

When I trace out the xmlDoc string I always only get "<?xml version="1.0" encoding="UTF-8"?>"

I have tried putting the whole document in one string surrounded by 's and concatinating the string like above. Why is the string var only getting assigned to the first line?[code]...

View 2 Replies

ActionScript 2.0 :: Assigning / Writing The Contents Of A Variable?

Jun 28, 2006

so im defining a set of complex movieclips with onPress and onRelease etc using an array of them, and then looping through the array and giving them all the same code.the only problem is in the code for my buttons is one piece that needs to be unique for each button. when i assign all the buttons with N they get the code N instead of what N really is. i need to hardcode/write the actual value of N into their onPress function instead of just the variable N. is there any way to do this?

View 5 Replies

ActionScript 2.0 :: Dynamically Assigning Variable Names?

Mar 29, 2007

dynamically assign variable names from XML? For instance, if I have an XML file with a list of variable names and their respective values, can I make my Flash movie create these variables?

View 5 Replies

ActionScript 3.0 :: Assigning Either Symbol To A Variable Within A Class?

Mar 24, 2009

I am currently develoing a flash game and I am trying to spawn 2 different symbols from a class. I have a Class called 'PLayerClass', which contains a variable called 'hero' which I assign a symbol to. This works fine with 1 symbol but I have no idea or if it is possible to assign a different symbol to the variable 'hero'. The 2 symbols are 'soldierOrange' and 'soldierGrey'. For both of these symbols I have matching classes (ie. soldierOrange.as).soldierOrange.as

Code:
package {
import flash.display.*;

[code].....

View 9 Replies

ActionScript 2.0 :: Assigning MC Instance Name To Generic Variable?

Dec 6, 2003

I'm pretty sure there is a simple solution to this problem and I'm going to feel really dumb for not figuring it out myself but for some reason I am stuck so here goes. I have several movie clip "buttons". I would like, on release, to load a dynamic text file into a container clip on the stage. Pretty simple right? Here is the code I am using:

[Code]...

View 14 Replies

Actionscript 3 :: Defining Variable's Data Type While Assigning New?

Feb 23, 2010

i'm linked a MovieClip class object to my project, and i will programatically add it to the display list. is there a difference between defining the variable's data type and not doing so? neither produce a runtime error.[code]

View 1 Replies

ActionScript 3.0 :: New MovieClip Variable - Assigning Value Of Event.Target

Feb 4, 2009

I am trying to define a new MovieClip variable and assign it the value of event.target in the function. I keep getting this error "1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:MovieClip."

import fl.transitions.Tween;
import fl.transitions.easing.*;
var p:Number = 0;
var scale_factor:Number = 0.4;
var tween_duration:Number = 0.6;
[Code] .....

View 9 Replies

Actionscript :: Flex 4.5 - Assigning A Variable After Service Data Load

Nov 20, 2011

I have generated a service call to a service called ServiceName.getService() - I can successfully pull data displayed inside mxml layout elements, but, instead of displaying it, I just want to assign it to a global.

I always get an error on the second line below - apparently the value has not been fetched yet. I have also tried adding a listener, and setting the global value on COMPLETE, but that is apparently never called. (I am guessing this generated service call stuff does not actually trigger a COMPLETE?)

Short question is: how do you simply assign a variable after you have loaded it via a service data call. (Not just HTTP)

getServiceResult.token=ServiceName.getService();
GlobalVars.variablename = getServiceResult.lastResult.variablename;

View 1 Replies

Flash :: CS4 Losing My Panel Groups

Aug 27, 2010

I've noticed recently (the last week) that when I open Flash CS4, the Tools panel and the Actions/Timeline/Compiler Errors/Output panel group are not automatically open, like they always were before. Does anyone know of anything I could have changed by accident?

At the same time this started happening, I have a file that has a moving hot spot that is set with keyframes (depending where the active button is on the bitmaped screen capture behind the button). Even though the  button's onRelease handlers are advancing the timeline correctly, my button is not in the right place in the runtime version. If's still fine in the development environment. It's like the layers are out of sync with each other.

View 1 Replies

Flash :: Session Data Is Losing With It

Jul 13, 2011

I'm using Flash uploader(uploadify, swfupload) with CodeIgniter, want to get the session data. I have found out that the flash does not send the session data, so I have set $config['sess_match_useragent'] = FALSE;

Now for example i have set session value myname in session and I can get it on my backend PHP script using Internet Explorer.[code]...

View 1 Replies

ActionScript 2.0 :: LoadAndSend Losing Some Values From PHP?

Aug 12, 2010

recently tried developing an flash application that would send info to php and php should read a browser cookie and pass back the cookie value as e.g myCookie = $myCookie, where:

$myCookie = $_COOKIE['test'];

Funny enough in Actionscript myCookie is read as blank but the other variables that are hard coded are showing. what could be the problem PLEASE HELP I desperately need the solution. My Code is given below:

PHP Code:

[U]file next.php[/U]
<?php 
$myCookie = $_COOKIE['test'];

[code]....

View 2 Replies

ActionScript 2.0 :: Losing The Path To External JPG?

Mar 1, 2011

I found the problem. I had my container as a guide. I took off the guide and it shows up in my server. But why did it show up on my local computer if it still was on guide then?I have external jpgs that are loading into a flash website. When I run it off my hard drive it works. But when I put it on my server the external jpgs are no longer loading. Does anyone know what I might be doing wrong with my paths?

[Code]...

View 0 Replies

ActionScript 3.0 :: Losing Mouse_up After Reparent

Mar 18, 2009

how to fix it:

Code:
public function setupDragDrop(asset:MovieClip) {
asset.addEventListener(MouseEvent.MOUSE_DOWN, function(e:MouseEvent) {
trace("1");

[Code]....

so basically just a function to add drag and drop functionality to an asset, note that when you mouse_down on the asset it takes it from where-ever it is and moves it to a container that sits at the top level in front of everything else.

This however appears to 'disable' the mouse_up event, which is never called in this case. If i remove the re-parenting then the mouse_up is called fine.

View 1 Replies

ActionScript 2.0 :: Losing Shared Objects On Update?

May 25, 2009

I just recently made an online game and was asked to implement saving features. Everything works fine but a single detail... When I update the swf (right now I have a new version with corrected bugs) people are gonna lose all their saved data !

Is there a way to use the same shared objects over multiple swf ? Or simply to keep them over the version change ?

View 1 Replies

Flash :: Losing Image Quality In Movie

Sep 10, 2009

I have a logo which I have created in photoshop, it is made up of 4 layers, some of which I want to animate. I create my movie, I do so by opening my PSD file and then animating the layers. However I have a problem in that when I view my movie the image quality is poor, and there is what I would describe as noise around some of the image.

View 1 Replies

Professional :: Losing Gradients When Importing Swf To Flash?

Mar 1, 2010

I've created a globe in Flash CS3 and published it (no compression) as a swf The globe has a couple of layers with gradients used as highlights. When I import the file into another Flash document the gradients seem to disappear

View 1 Replies

Professional :: Losing Quality While Exporting Clips As MOV Or AVI

Oct 31, 2011

I want to know something abt flash... When I am creating any clips in flash cs3 and exporting that as a video (avi or .mov) it loses the quality...

View 2 Replies

Professional :: Converting .swf To Video Without Losing Frames

Feb 11, 2012

This question has been asked and incorrectly answered a number of times already. Specifically, on an Apple computer, it seems that there is no way to get a video file (.mov, .mpg or any other) out of Flash Pro without severe loss of quality or complete destruction of frame rate.

My .swf files look fantastic, just like they are supposed to. The play at the correct frame rate and all items work as I have set them up. When I go to export it as an .mov or .mpg, the frame rate speeds up and slows down depending on the objects on the screen. I have played with the settings endlessly, knocking the quality down to almost the lowest settings (something I would rather not do after working very hard on my piece) as well as adjusting the frame rate options all over the place to see if anything changed. Nothing. I have read many a forum where Flash creators have the same problems and are tearing their hair out because their work is essentially useless being stuck in Flash.

I know that there are programs that convert .swf files to video very well, some of them cost about $100. Why buy Flash in the first place if you have to buy another, almost equally priced piece of software just to get your content out of Flash? I also know that there are hundreds of free video converters out there for Apples, none of them seem to be able to handle the .swf format, but can do just about everything else. I further know that for windows, there is the free Iwisoft .swf to video converter that works just fine, but does not handle Apple created .swf files when ported across to a PC. How is it that such software is easy and free on a Windows machine, but not a Mac?

I would love it if an Adobe rep could answer some of these questions because I have been all over the web looking for answer to which no one seems to have the right one. Most people can suggest a good video converter that works for them, but they haven't tried it on a .swf file and when the original user tries it, it does not work and the thread dies there.

View 11 Replies

Actionscript 3 :: Flash Stage Losing Focus?

Feb 2, 2010

I built this incredibly brilliant scrolling thumbnail image viewer for a client in flash actionscript 3. (Basically it just scrolls up or down depending on the mouse position). It works so so, (I can never get the percentages right so that it shows the top most image) but, that's beside the point. What is REALLY irking me is when I have the browser window open with my .swf loaded and I click on another app on my desktop, the stupid scrolling thumbnail area in the browser window starts to freak out.

"Where is my mouseY?" I assume it is thinking.

Is there a stage.Unfocus event I can tell my scrolling thumbnail area to STFU with?

I'd even consider writing some javascript to call a flash function, if that's a preferred technique.

function checkMousePos(e:Event):void
{
if(mouseX < 145){
try{

[Code]...

View 2 Replies

Flex - Losing Extension When Use FileReference Download

Jul 14, 2010

I need user download JPEG file from my app, however, when user change the file name the saved file will be downloaded without extension.

For Example: I am using FileReference.download() and set the default filename as "demoPic.jpg" and user's windows system setting control file extension not being shown. So when the dialog opens a download window, only "demoPic" shown as the filename. If user saved file without changing filename, the saved file will be OK. But if user change file name, the download file will be saved without extension. is it possible to add file extension to filename when user forget it by flex code?

View 3 Replies

Html :: Flash Losing Variables On Hide?

Aug 17, 2011

I have a flash file in a div. This div is set to visible (display:block;). The div has two sister divs. All three divs are controlled by custom built jQuery tabs, so when another tab is clicked, the currently visible div turns display:none;. When the tab is reclicked to set the flashes div to display:block, the flash file loses all its values that are stored (for example in a textarea, all the text gets reset, and where a element stores a path to the image, that gets reset).

I have tried other methods like width:0; height:0;, which sort of works, but as the flash file is larger than the other two divs, it is still visible underneath. So then I tried overflow:hidden; but the same issue still occurs as above (losing values).

visibility:hidden isn't applicable as there is a large white space where the flash file should be.

position:absolute; top:-800px; left:-600px; loses variables.

border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; also loses variables.

Is there any other method I can use? I have wmode=transparent aswell.

Below is the code of my flash embed:

<object wmode="transparent" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="690" height="2047" id="gdh_v3_1" align="middle">

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved