ActionScript 3.0 :: Creating Topic/SubTopic(accordian) Navigation Using This Function?
Jun 29, 2010
I'm trying to create an accordian style menu using the function below, which is structured off the xml file posted below as well. I have everything parsed into Flash and can see all the data, as well as the movie clips being created. What I AM having a problem with is positioning the movie clips appropriately. The submenu items should sit directly underneath the menu items, like a traditional accordian menu looks, but I cannot come up with the right formula to make this happen.
function createXMLMenu(menuLength:Number,itemName:XMLList):void{
var navItemText:XMLList = itemName;
//Create dynamic menu based off
//menuLength parameter being passed in
[code]....
View 1 Replies
Similar Posts:
Oct 26, 2010
I have an application w/ 2 side-by-side pages of text. I have the VDivided box set up so the user can drag it to make one of the documents bigger or smaller.Is there a way to get the look of a VDivided box & the functionality of an Accordian, so that when the user clicks the VDivided box (or double clicks, I haven't decided) one of the documents will be hidden? (For instance, double clicking on the right-most side of the divider will hide the left document, and vice-versa)
In addition, if the user wanted to drag the divider, then they can do that as well. I don't have much, but here it is so far:
<mx:HBox width="100%" height="100%">
<mx:HDividedBox width="100%" height="100%">[code]......
View 1 Replies
Feb 27, 2011
I have an Accordian in my application. Each child of the accordian has a label firstNameLabel) and a button (addPolicyButton). The label's value is being set via Repeater and an array. How can I access the firstNameLabel's value of 'selected child of the accordian' when the addPolicyButton is clicked?In following code testTextArea.appendText prints 'fname: undefined' in the testTextArea.Where as I can see in the accordian that the set label's text is set to 'Michael' which is what repMonitor.currentItem.firstName returned.
Code:
private function addPolicy():void{
testTextArea.appendText("fname:"+firstNameLabel.text);
[code].....
View 1 Replies
Jan 21, 2010
For a school project we have to make a presentation about our RME topic, and we can to it in any format we want. I want to do it in Flash so as to add interactivity. Problem is, I am not certain on parts of it.
How do you add buttons, so as to change the background? For example, it shows title screen. Then you click.Then it shows first slide like. Then you can click like, Introduction, The Pillars of Islam, ect.
View 4 Replies
Nov 27, 2009
i have been learning ActionScript for 7 or 8 days now. It's been a easy journey.
I'm curious, what is the hardest topic when you learning ActionScript ?
When i'm learning C++, pointer is a brain buster. What is the hardest topic for ActionScript ?
View 9 Replies
Jan 14, 2010
I am an intermediate flash user and need to create navigation for my flash project. Basically what I have is one swf with several scenes and I need a small pop up menu with clickable buttons to jump to different scenes. I know scenes are not generally recommended, but I cannot load separate swfs due to technological constraints at my company. The way my project is set up is like one continuous movie that plays from start to finish. I don't need a player controls or anything. I have divided it into scenes to make it easier to work on the fla.
It starts and plays through to the end, one scene after the next. What I want is a small menu button at the bottom that when clicked pops open a list of buttons that can be clicked to jump to and play a different scene. It never stops or anything, just jumps to and plays the chosen scene. I have created a movieclip with a menu button and the pop up list with buttons. I can get the list to open and close, but it won't jump to a different scene. Is this because it is in a movieclip?
View 2 Replies
Feb 20, 2005
I created the scrolling navigation, akin toby changing a script that I had. However, I'm stuck now, as all the buttons can move to the left, but not to the right. If it does not make sense, check out the attached swf and fla.I'm not too good with if else statement and x y property.
View 2 Replies
Aug 21, 2006
I am working on a navigation for a page that consists of an image container, a text block, and a navigation. I have all the content in an xml file that is loaded and parsed placing each part of the site in its respectable spot. My question is I need to have the data for this site change when a button in the nav is pressed, so that the image and desc content is passed that corresponds to its button. this is in flash 8, as 2.0.
[Code]...
View 1 Replies
Oct 5, 2010
I have created a Viewstack and using a Tile component and repeating LinkButtons I was able to make a multi column navigation with the viewstack as the dataprovider. My question is can this be done better? My code is below and I am wondering if I took the long way around this approach.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
View 1 Replies
Apr 22, 2009
In a nutshell, the swf contains four ads (which link to portions of the site) and each ad uses the Timer element, displaying it for 5 seconds before moving on to the next one. Everything has come together nicely (although I'd like to clean up the code and use classes at a later date - I'm currently taking AS training from Lynda.com).
What's giving me trouble right now is the navigation bar. What I want to do is create four numerical buttons that a) change color during a mouse roll over b) change color for a corresponding ad (for example, when the third ad displays, the number "3" changes from white to gray to show that it is active and goes back to white when the fourth ad comes up).
Right now, I'm at a loss as to what to do. I've tried making the numbers buttons, but I can't control color changes unless I create two sets of buttons: one with white numbers, one with gray numbers.This also makes for some really bizarre Actionscript coding ideas (ex: after I code the function for the gray nav buttons, I have to code functions that make the white buttons work - but this ends up screwing with the ad cycles). I tried making them as movie clips, but I lose the ability to assign a large hit area like I can with buttons.
View 5 Replies
Jan 24, 2012
I am trying to create the code for a navigation in Actionscript 3, but I get the error "Function has no body". And the test just plays over and over without stopping?
// Navigational code
stop();
import flash.display.*;
import flash.events.Event;
function myReceiver(event:MouseEvent):void{
[Code] .....
View 2 Replies
Oct 17, 2006
I know how to do custom cursors. I know how to do a MC controllable by keys.Next I would like to create a MC thats controlable by keys and effective on normal(!) buttons. (So don't give me that hitTest crap.)To illustrate the idea:Also, when I use this script:
Code:
onClipEvent (load) {
Mouse.hide();
[code].....
View 2 Replies
Jul 17, 2008
i took a look at many menus and treid to find the right one for me. I think I've found it: http:[url]...at the bottom, theres a menu that scales in relation to the mouse position. an when you roll over it comes up. the selected item is shown also when it's closed again. how to realize this. I only worked some times withe the laco tweening class but how can i build up that really cool menu?
View 4 Replies
Dec 19, 2009
I have begun on a list: My reference is null!Stage is null! Convert this code from as 2 to as 3 for me! Crossdomain policies are in the way of my cool idea Dynamic property names I need to use stuff on the parent! I don't want my children to scale when I scale the parent! Classes vs instances. Mod note: I do not want this topic pinned, we will use a fresh topic once we have agreed to the content.
View 9 Replies
Jul 2, 2011
I'm trying to make a Flex-based desktop application consume messages from an ActiveMQ topic with a durable subscription, using the JMS bridge of BlazeDS. The basic scenario is as follows: Messages are produced by other producers in the topic to which the Flex client is subscribed. The Flex client may go offline from time to time, but it must receive all the messages it has missed while being offline when it connects to BlazeDS again. (Of course the Flex client connects with the same client ID every time). It can not be guaranteed that the Flex client is shut down gracefully.
Everything works fine if I explicitly disconnect my consumer on the Flex side by calling disconnect() - I do it in the exit handler of the application. However, due to #3 above, it is not guaranteed that disconnect() is called all the time. When the Flex client shuts down without calling disconnect(), it seems that the subscription of the "proxy JMS client" that BlazeDS creates and associates to the Flex client stays active towards ActiveMQ, so ActiveMQ still thinks that the client is logged in. When the Flex app starts up the next time, it is unable to log in to BlazeDS because ActiveMQ refuses its subscription, claiming that the client ID is already taken. Why is it so and what can I do here to ensure that BlazeDS makes the "proxy JMS client" offline in ActiveMQ when its real Flex counterpart terminates unexpectedly?
More detailed information: some debugging revealed that:
[Code]...
View 1 Replies
Apr 29, 2011
So I've gone through a few different websites looking for a way to make a symbol a link, and I keep running into the same problem. I am using action script 3.For example, I got this code from this page:[url]....[code]......
It makes the symbol (logolink) a link (changed the mouse cursor to a pointer), but it kills my animations and errors out saying (all on line 4...the function callLink line): "expecting leftparen before colon", "expecting identifier before leftbrace", and "expecting rightparen before leftbrace".I tried a few things like adding an unused parameter, and a couple other things (trying to satisfy the above errors), but then I get "call to possibly undefined method addEventListener through a reference with static type Class"
View 6 Replies
Apr 21, 2009
I am relatively new to Flex/ActionScript, but I have been using a pattern of creating one file per function in my util package - with the name of the file being the same as the name of the function.
Like if the file was convertTime.as:
package util{
public function convertTime(s:String):Date{
...
}}
This way I can import the function readily by doing:
import util.convertTime;
...
convertTime(...);
I like this way better than importing a class object and then calling the static methods hanging off of it, like this:
import util.Util;
...
Util.convertTime(...);
But, the more I do this, the more files I'll end up with, and it also seems a bit wasteful/silly to put only one function into a file, especially when the function is small. Is there another alternative to this? Or are these two options the only ones I have?
View 4 Replies
Sep 2, 2009
i have a set of "if conditionals" that should always be together,what i want to do is to put these conditionals in a function... then call the function once needed. i want to call this function once the flash starts playing + when i click on any of the 3 buttons.
here is the code so far:
ActionScript Code:
var btn1:Boolean=true;
var btn2:Boolean;
var btn3:Boolean;
[code]....
the problem is button1 should have no eventlistener once the movie starts playing, but it has all listeners... so how can i make AS reads BtnStatus function once it starts loading
View 2 Replies
May 5, 2010
im having trouble creating a fully function iphone in flash and create user interaction witht he app.how to do this i have create the different app stages and how they look in photoshop
View 5 Replies
Jul 10, 2011
Just transitioning into object orient programming and I got stuck trying to create textField using static function. I searched online about this and none of them were useful. I dont want this to be just public function because then I cant access this function from other classes. I would like every classes to access this function so I need it to be static.
package {
import blahblah
public class example extends MovieClip{[code]..........
View 6 Replies
May 27, 2010
Im trying to create a simple loop that creates 50 buttons, adds them to screen and then when a button is pressed, it traces out that number. I can get it to work by doing stuff I consider hacky (such as using the buttons X/Y location to determine its value), but I'd rather just be able to hold a single value in the function.
The code itself is:
for (var a:int = 0; a < 5; a++) {
for (var b:int = 0; b < 10; b++) {
[code]........
View 3 Replies
Jun 19, 2011
openList = Array([1,1], [2,3], [4,5]);
containss = function (input, arrayData, tellID) {
for (i = 0; i < arrayData.length; i++) {
if (arrayData[i] == input) {
[code]....
This code returns false when openList contains 2,3. When I add trace(arrayData[i]), I get 1,1 2,3 4,5 and when I do trace(input) I get 2,3.
View 1 Replies
Aug 13, 2011
I've been trying to write a function to create a simple circle in Box2DFlash . but it keeps telling me that the object is null and I can't access it's properties here's the code:
public var f1:b2Body;
public var f2:b2Body;
public function addACrate(fallingCrate:b2Body,
[Code]....
and when I try to access the "y" property of my "f1" object it tells me that it's null .
View 2 Replies
Jul 15, 2009
I have a function in which I declare a bunch of variables that I need to be globally accessible from outside the function.[code]I need numVals to be accessible from outside the function.I tried changing the name to _global.numVals and it didn't work
View 4 Replies
May 10, 2011
I would like to make a function that lets me load a movie clip onto the stage like this:
ActionScript Code:
function callImage(i:Class):void {
var img_loader:i = new i();
stage.addChild(img_loader);
}
callImage(b0_base);
b0_base is the class name for my MC. Is this possible? or do I have to write a different function for each Movie clip?
View 5 Replies
Jan 19, 2012
I want to create some functions similar to how GreenSock's tweening class works.With the optional parameters by name in brackets. {}[code]I get this error: "Parameter initializer unknown or is not a compile-time constant."Pretty sure it's the "Parameter initializer unknown", but I don't know what to do about it.
View 8 Replies
Nov 22, 2005
I have this long list of video files(some 500 of them) to be linked to my flash interface. I am looking at the option of creating a search engine such as that when the user key in some keywords, it will search thru my list of video files and bring up the appropriate files. (results will show names of files first then user can choose to click on those that they want to view)
View 8 Replies
Aug 28, 2006
basically i have a mc that i want to use as a button.
frame 1 is the initial state with a stop() action on it. frame 10 is the full rolled over state, also with a stop() action on it, and frame 20 matches frame 1.
so basically i want the button to animate frame 1-10 if they rollover, and animate frame 11-20 when they roll off. i would also like it to detect the current frame, so like if the user rolls off and rolls back on at frame 15, it will play backwards to the mouseover state (frame 10).
View 3 Replies
Sep 3, 2006
Code:
for (var i:Number = 0; i<12; i++) {
var myFunction_i:Function = function () {
trace("This is function "+i);
};
[code]....
I'm needing to create identical functions but different 'i' Number Variables so that I can call them as shown when I need to.
View 8 Replies
Apr 14, 2009
I have "class A" that makes a bunch of objects from "class B"
class A
Code:
public function classA(){
for(var i:int = 1; i<=num; i++) {
var b:classB = new classB(i);
[Code]....
I need to call a function in "class A" from "class B" but I'm not sure how to do that.
class B
Code:
public function stoppedMoving() {
// check for overlap in "class A" here.
}
View 5 Replies