ActionScript 2.0 :: New Shipping Charge Is Added To The Buyers Total For Every Item Added?
Jan 21, 2011
I am using a Flash AS2 template for a PayPal shopping cart on my site. As the code is now, a new shipping charge is added to the buyers total for every item added. I would like it to have only 1 shipping charge, no matter how many items are added!
Actionscript Code:
import caurina.transitions.Tweener;cartItems = new Array();itemNr = -1;itemQty = 1;cartin = false;ctrl_mc.cart_mc.onRelease = showCart;attachMovie("cart","cart_mc",15000,
[code].....
View 1 Replies
Similar Posts:
Feb 9, 2011
I have created a button class which has graphical elements. In future I might want to add this as a child to other things so what I would like to know is, firstly, can I get the details of the parent object from the child and, probably more importantly, is there an event that tells me when my button has been added as a child so that I can resize it?
View 2 Replies
Jan 19, 2010
I know this is simple, but I just can't seem to get it right. I am adding a series words to the stage and want each one to move with an ENTER_FRAME listener. The way I have it now only targets the last one added. How do i have it apply to each child when it's added?
[Code]....
View 1 Replies
Feb 24, 2010
Array ( 0 , 1, 2, 4, 5, 6)I wanted to add in 3 in between 2,4 so it becomes ( 0 , 1, 2, 3, 4, 5, 6)how can i do it.
View 3 Replies
Jun 22, 2011
I know how to remove duplicates from an array, but what I'm trying to do is prevent an item from ever being added to an array in the first place if it already exists. I'm pulling in data from an xml feed in a loop, and I thought that searching for that values index would work, but no matter what, the index is always -1. Here's my code:
[Code]...
Maybe I'm misunderstanding the indexOf function, but I thought it was supposed to return -1 if a value did not exist in an array. What am I doing wrong?
View 4 Replies
May 10, 2009
I'm trying to access a movie clip on stage but my event listener doesn't seem to respond to the added to stage event. I've checked the code and it seems to be correct but just doesn't work. the movieclip i'm trying to trace is sb.
[Code]...
View 5 Replies
Nov 27, 2009
I'm getting a list of movieclips with attached scripts to display, but when I try to put them on the sceen nothing shows up.I can trace the elements in the list and it will tell me there are elements there.I can trace getChildAt(numChildren -1) and it will tell me there is something there but nothing is visible.If I generate the list in the constructor of the class that handles the displaying it does show them, but when I try to load them when they are actually needed they don't show up.Here's a simplification of the code(its a small part of a larger project and I can't put all of it up somewhere public)This code does what it should do(unfortunately that is not what I need done)
Code:
package foo.bar
{
import flash.display.MovieClip;
import flash.display.DisplayObjectContainer;
[code]...
The traces all show up so I know its running the method, the traces tell me it adds stuff the the screen, but what I see on the screen remains completely stagnant, as if nothing is being added.
View 2 Replies
May 10, 2010
Im trying to use the added eventlistener. When a child is loaded i then wish to trigger to a function. But the function seems to be triggering before the graphic is load.I am using this for some press loader functionality before a database is queried.[code]The above if statment works. But inizRequestOfData() seems to be trigged before the loading of anygraphic is done.
View 7 Replies
May 10, 2010
Im trying to use the added eventlistener. When a child is loaded i then wish to trigger to a function. But the function seems to be triggering before the graphic is load. I am using this for some press loader functionality before a database is queried. My code looks like this....
loadingicon = new loadIcon();gridCradle.addEventListener(Event.ADDED, loadiconAdded);gridCradle.addChild(loadingicon); public function loadiconAdded(e:Event) { if (e.target == loadingicon) { troot.debugger.htmlText+="icon loaded" gridCradle.removeEventListener(Event.ADDED, loadiconAdded); inizRequestOfData(); } }
The above if statement works. But inizRequestOfData() seems to be trigged before the loading of anygraphic is done.
View 1 Replies
May 20, 2010
In the actionscript below I am trying to get it so that if the rateablevalue text field is less than 18000 then the raterelief_txt text appears, but if it's more than 18000 the yousave_txt, the pound_txt and the results_txt appear. I want them to disappear if a different value is added afterwards.
[Code]...
View 16 Replies
Jan 24, 2011
I've just added a flash application to my web app. And from time to time, I get emails from users (very rarely though) with screenshoot and information that they don't see flash. I've investigated that those users have flash plugin installed, and they can see flash in other browsers. On the screenshoot there's blank white space instead of flash - no messages on bars that flash plugin is missing, nor information in place where flash should appear. Some of those users were accessing my application within PC located inside company. Is it possible that it's some kind of browser policy is blocking the flash? is it possible to provide user with a message if flash is blocked somehow or no flash plugin is installed?
View 1 Replies
Jul 21, 2011
I am making a simple xml gallery that loads in images into a movie clip that looks like a Polaroid. So, the idea is that flash will see how many image need to me imported. Then in the for loop it will add child the Polaroid mc (which has been exported for actionscript and the class named "Polaroid"). The inside that Polaroid mc there is an empty mc called "polimageHolder_mc" that I want to load the xml loaded image into. I keep getting this error "TypeError: Error #1010: A term is undefined and has no properties", when I use the code below. It makes sense to me but my syntax is obviously incorrect. [code]...
View 3 Replies
Apr 16, 2009
I use some script of grid gallery. it works great and its based on xml file with this structure:
PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<GALLERY XPOSITION="5" YPOSITION="5" WIDTH="100" HEIGHT="100">
[code]........
View 1 Replies
Jan 20, 2010
I've got MovieClips on the stage, both manually added, and added with code. I used this code to trace them all:
for(var i:int=0 ; i<stage.numChildren; i++) {
var myObject = stage.getChildAt(i);
trace(i);
trace(myObject);
}
All it returns is 0 and [object MainTimeline]. Is there something wrong with Flash, or did I do my coding wrong? The objects I put on the stage should be on the Display List, right?
View 5 Replies
Jun 24, 2010
So when you win my game I add a movieclip that will let you enter your name through a text input component. Unfortunately, I'm calling it wrong.
I'm getting an undefined property error because it's out of the youWon function, right? You'd think I'd understand this concept eventually!
[Code]....
View 2 Replies
Dec 3, 2008
while workign on this i am trying to add a lable to the Movie which is dynamically added using addChild(myLabel).
i cannot add no error no out put but i am able to add button and grid without issue .
View 2 Replies
May 28, 2009
I am having some trouble understanding the display list. This might sound silly but how long does it take until a sprite is added to the display list?
My understanding is that the root variable is only accessible once the object is added to the display list.In the following code I add the TLSEntry_Text to the display list and then on the next line I try to trace its root variable without luck. The root variable appears only in the enter frame event... I guess a little bit later.
What am I missing here? Is there a way for the display list to "force refresh" itself?
[Code]...
View 5 Replies
Sep 8, 2009
I find myself inbetween the AS2 and AS3 world with this project. I added an audio file in a project which is a narrated presentation. If I play the timeline the audio plays but when I stop the playhead the audio continues to play. To tell you the truth I could not even remember having to do this in AS2 not alone in AS3. I have the audio preferences set to specch to make the file smaller, have the frame rae up to 30 frames per second as I'm using FlashEff for text and movieclip effects.
Is there away to be able to stop the audio so i can see and hear where I am when I start dropping the text and pics in the project?
View 1 Replies
Feb 9, 2010
so I need to know if there is a way to understand if an Object has listener added to it. I mean:
myObj.addEventListener(event.ENTER_FRAME, handler);
listenerList:Array(?) = myObj.function_I_need();
View 1 Replies
Feb 22, 2010
So I have a looping SWF file that I uploaded on my website. It played perfectly until I decided to add a preloader.
I set up the Flash file with 2 Scenes, "Preloader" and "Scene 1" .The Preloader scene will play just fine. After the preloader plays, Scene 1 then begins to play as it should. However, once the animation ends, instead of looping like it did before, it just stops on the first frame.
How can I get my SWF to play the Preloader, and then continue looping the main animation (Scene 1)?
Here is my AS:
import flash.events.ProgressEvent;
function update(e:ProgressEvent):void
{
var percent:Number = Math.floor( (e.bytesLoaded*100)/e.bytesTotal );
[Code].....
View 2 Replies
Aug 3, 2010
I've been working on a project that's about 500k for the .fla, and 36k for the .swf
On my latest export and save, the .fla is coming up 25k, and the the .swf is 120k - 120k is wayyyy too big for what I'm doing. The fla seems to be all intact even though it's only 5% of what it used to be.
I haven't changed any of the publishing settings.
I tried loading an older version of the project (from a month ago). When I export that version, the swf also comes out at about 120k instead of 36.
I'm using CS5, and have only had it a few days (was using CS4) - is there some new function that could affect the file sizes so drastically? It's strange, as it was exporting fine until about an hour ago.
View 5 Replies
Oct 22, 2010
I'm creating a website, on the stage I've got a menu and a movieclip which I use to show my pages, the movieclip's name is pagecontainer_mc.Each page is an exported class for AS3.When I click on a button on the menu, with removeChildAt() and addChild() I remove the current page and show the requested one.Everything ok with this.The problem comes when I need to call a page not from the menu, but from a button inside another page.I've tried writing this code on the main timeline:
var contacts:contatti = new contatti;
pagecontainer_mc.contacts_btn.addEventListener(MouseEvent.CLICK,showCo ntacts);
function showContacts(e:MouseEvent):void { pagecontainer_mc.removeChildAt(1); pagecontainer_mc.addChild(contacts); }
[code]....
If I put the code inside the page's timeline I can't access to pagecontainer_mc (or at least I'm not able to do that).
View 3 Replies
Jun 27, 2011
I'm dynamically adding rows and they don't seem to go under the proper column. I have all of my headers in 'headerArray' and the data i need to add is in the string 'item'.
//create an item to work with
var chartItem:Object = new Object();
for( var j:int = 0; j < columnResult.length ; j++ )
{
[Code].....
It's getting all the headers properly and setting the chartItem (from inspection with debugger). When it gets to a row (building from html) where there is an item that only has values for some of the columns, it doesn't add the information under the right column, it just goes from left to right and adds it in the next one.
The behaviour is kind of strange because the chartItem clearly has the right header value and corresponding item value in it, but like I said they don't end up under the right column.
tableCollection gets set as the dataprovider for the grid later (not modified since)
View 1 Replies
Feb 28, 2012
public class ItemView extends MovieClip {
private var _title:TextField;
private var _extra:MovieClip;
[Code]....
When I create an instance of ItemView and add it to the stage, "Title" displays but the blue square does not. However, if I make the graphics calls on this instead of _extra, I do see the blue square. This tells me that _extra itself is not displaying properly, but I can't figure out why. Is there some special procedure for adding one MovieClip to another?
View 2 Replies
Feb 22, 2009
I have 4 functions called by their own buttons. Each function calls a movie clip from the library with addChild. When I click on one of these 4 functions I want it to remove the added children if any of the other functions had been clicked prior. Problem is, removeChild at the start of each function results in errors if a child had never been called yet. It's trying to remove something that isn't there. - So I tried making a 'flag:number = 0' for each of the 4 functions. Each function begins with settings its flag to '1' I put a for loop at the beginning of each function saying IF any of the flags are = to 1, then remove the children. I don't see why that should not work, I think the error lies in my array or my for loop if statement as I still don't fully understand them. So I will just post the code relating to the array and loop:
[Code]...
View 9 Replies
Jul 7, 2009
i have got my Library item added to the stage multiple times in a for loop. now how do i access each individual added item?
i have tried.
ActionScript Code:
private static var rootClip = null;
private static var _addedCount = 1;
[code]...
and Yes, this code is inside a static class.OK so thats not ALL of my code. Just enuf elements to understand how i need to do it..how can i get that trace to spit out all the names of the added clips?and/or get the clip that i added 4th to goto .x = 400?
View 4 Replies
Jan 21, 2010
've been trying to figure out how to refer to the stage from a Sprite before it is added to the stage.
I'm working on a small program in which I plan to use external classes for each "window" that comes up. I've made the window classes extensions of Sprite. I'd like to make this window add itself to the stage when its constructor is called, and then just remove it from the window class when I'm finished with it. Is this a good idea? I'll post some of my code to show you what I mean.
This code doesn't work. I get the error "type was not found or was not a compile-time constant: Stage"
From my window class:
ActionScript Code:
public class PlayerSelectionWindow extends Sprite{
var stg:Stage;
[Code]....
View 2 Replies
Jan 21, 2010
I have an XML driven Mp3 player with a "download" button that appears when song is highlighted. I just need to call the text from xml and add it to the URL: See sample of player
this adds the name of the mp3 to the end of the url but I need it to add text from a child in the xml called "siteurl" instead.
ActionScript Code:
on (release) {
getURL("http://www.bytecommerce.com/" + path, "_blank");
}
[Code].....
View 7 Replies
May 13, 2010
I'm looking for ways to use movieclips that I've added on the stage in ActionScript. I can't just adress the movieclip by its name because apparently AS3 won't recognize a movieclip name if you haven't created it within the script.
The way I'm going about it now is to check the instance names of every child on the stage (with a for-loop from 0 to numChildren) and if the name starts with a certain text, I create a movieclip in ActionScript like so[code]...
View 9 Replies
Nov 25, 2010
I have 2 different classes that contains different object. And I control from another custom classes on when to load which class. The custom class will load a class when first run, and switch to another one when selected. My problem is, although I called the next class, but the object does not appear. The class that controls which to load
ActionScript Code:
package classes{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import classes.streamVideo;
[Code] .....
View 0 Replies