Variables in children
On my main timeline I define a variable and it works:
var totalpages:Number = 1;
trace(totalpages);
In a child movie clip I try to recall the variable and it
traces "undefined":
trace(MovieClip(parent).totalpages); or trace(totalpages);
they don't work.
What do I do to correct this? Thanks.
I made a test file from scratch using only the code describe
above and it worked fine. So it's definitely something else
interfering with this variable. Thanks for the help.
Similar Messages
-
Killing a sub process from it's parent process
does any one know if ther's a way of killing a sub process from it's parent process?
There are a few ways to do this depending on how the subprocess was invoked and if you are inside the parent work item instance or if you are using PAPI.
If you are not using PAPI, here's how you could abort the child work item instances spawned by a parent process's work item instance.
Asynchronously Spawned Children
If a child process was invoked using an asynchronous Process Creation activity, the work item instance in the parent has a predefined hash table variable called "children". Downstream of the parent's Process Creation activity (called "SpawnChildren" in the PBL logic below), you can get the child's instance id using the children hash table and use this to send a notification to a Message Wait activty in the spawned child process instance using logic like this:
send Notification
using instanceId = children["SpawnChildren"],
activityName = "TerminateChild",
parameters = nullThe Message Wait activity needs to have its "Allows Interrupt" property checked in the child process. As you add this Message Wait activity (called "terminateChild" in the example above) make it an orphan with no transitions in or out initially. Once notified by the parent process, it still needs to be aborted so add a new Automatic activity in the child with this logic:
action = ABORTFinally, add a transition from the Message Wait activity in the child subprocess to the Automatic activity.
Synchronously Spawned Children
If all you know is the parent work item instance's id and the child subprocess was invoked using a synchronous SubFlow activity, you could send a notification to a Message Wait activity that has it's "Allows Interrupt" property checked in the parent. If the Message Wait activity flows to an Automatic activity, you could use logic like this to kill the child subprocess work item instances synchrously spawned by the parent:
for each ch in ProcessInstance.children do
send Notification
using instanceId = ch,
activityName = "TerminateChild",
parameters = null
end
action = SKIPSince the parent's instance was stuck in the Subflow activity, you'd need to send a notification to the parent's Message Wait activity in the parent process. -
Is there any work-around in Mavericks for DVD burning issue's
Ever since I installed the updated OX I get errors and problems burning disc's ( with my external Sony and OWC DVD burner's. Sometime's it freezes in the middle of burning and other times it hangs by the verification process. Even using Apple's own internal burner give's me these issue's. Even aborting the burn after it hangs is problematic. I usually have to turn off the burner and then on again and eject the disc . I use the latest version of Toast but have tried with Mac's own burning option. It makes no difference, both ways aren't working for me. In Bootcamp while trying to burn (on PC) side. The computer keeps crashing. I have had this experiance on my iMac and Mac Book Pro both early 2011.
Hi Pavan,
I am assuming you want to persist some intermediate values from a process XSLT invocation to another process XSLT invocation in BPEL.
An approach to persist variables in XSLT could be to persist them the target variable itself (in an optional section):
<li>This can be achieved by having an additional root element and mandatory element (say, data), having the actual schema and an optional complex type element (say, parameters, which would in turn consist of 2 elements name and value and maybe, if needed, type) attached to both the source and target schemas.
<li>whatever variable you would want to persist, you can append it in the XSLT to the target variable,as children of parameters node.
<li>Whenever, you want to invoke a partner link, you can have an assignment before invoking, which would assign the actual schema data (from element data) to the input variable of the invoke.
As there is no inbuilt solution for this, things could get messy.
Regards,
Shanmu.
Edited by: sthiagar on Feb 15, 2010 5:31 PM -
Find sub-instances in Java/PAPI or in FBL in 5.7
If I have an instance (let's call it "A/1/0") in process A with a subprocess B with a split-N creating 4 more instances, for a total of 6 instances.
How can I abort (cancel, kill, whatever we want to call it) "A/1/0" AND all of it's corresponding instances in sub-processes and below.
...Running 5.7 MP3.
Thanks,
ToddHi Todd,
I think you have to make 2 steps.
1- Find out which is the child instanceID
2- Abort the instance and its child (as a result the child copies (created in the splitN will be aborted too)
How to do it
1- The instance has a variable called "children" which has the association between the activity and the instance created.
Eg.
childrenInstanceId = this.children\["MySubflowActivity"\];
It seems to be that the children variable is not accessible from PAPI. So, you can create a read-only global activity with instance access that returns (as an output argument) the child instanceID.
2- That's the simple one, just call the instancesAbort PAPI method.
Hope this helps,
Ariel A.
Edited by: Ariel A. on Mar 5, 2009 12:22 PM -
TreeItemRenderer with variable number of children
Hi all,
i'm trying to create a TreeItemRenderer that has a couple of
buttons, the number of buttons depends on the data in the item.
The problem is i don't know where to call the addChild()
method on the TreeItemRenderer. Normally i'd override the
createChildren() method, however at this stage the data property is
not set yet.
The next thing that came to my mind was the set data()
method, unfortunately this method is called several times after the
TreeItemRenderer is instantiated, which disqualifies it for adding
children i guess.
Has anyone an idea how this could be accomplished ?
Any hints greatly appreciated, thanks !"pulse00" <[email protected]> wrote in
message
news:ghhesj$ho2$[email protected]..
> thanks for the hint. i still have one question about
memory usage though:
>
> Would it be ok to simply create or remove buttons in the
commitProperties
> method and
> the garbage collector would clear the memory of the
unused objects when
> they
> are
> removed from the itemrenderer ?
They will be garbage collected as long as there are no
references to them
(for instance, no event listeners).
> The other thing that came to my mind is to maintain a
reference to all
> DisplayObjects i need
> in the itemrenderer and simply remove / add them to the
container as
> needed.
You could look at the List Based controls and see how they
handle it.
> I'm a little concerned about memory usage as the Tree
that contains those
> itemrenderers will be
> refreshed quite often.
Just make sure not to do anything that can't be garbage
collected. -
Loop through a model to get variables and values
I use an AS model (named AppGlobals.as) to store the application variables. I need to replace the hard-coded values of the elements to ones pulled from a database. As such, I need to iterate through the model to find all the elements that match my query results and then set the value of the elements to those returned from the database query.
My current issue is that I have no clue how to iterate through the model to get the elements so that I can use them a parameters for my query. An example of AppGlobals.as follows...
package com.models
[Bindable]
public class AppGlobal
public var appAnnualMaintenanceAlert:String="The System is unavailable due to routine annual maintenance! Please check back after 2:00 PM Eastern on January 1, 2012!";
public var appAnnualMaintenanceStart:Date=new Date(2012, 11, 31, 18, 0, 0, 0);
public var appAnnualMaintenanceEnd:Date=new Date(2013, 0, 1, 14, 0, 0, 0);
public var appYearPrevious:String="2011";
public var appYear:String="2012";
public var appYearNext:String="2013";
public var dttm_landing_expected:String="1/1/2012 12:00:00 AM";
How can I iterate through the model to find all the var names and then match them with my query to return the corresponding values? Any help is appreciated.
Thanks!
LeeHi,
"elided" and "hidden" both have UI purpose (make the UI lighter) but are quite different:
"elided" is a static attribute of property groups (readonly, and After Effects never changes the value internally).
The children of an elided group are not necessarily elided.
"hidden" is NOT an attribute, is dynamic, and "undocumented".
The After Effects UI hides everything that is not needed in the layer property tree (for instance the material option group is hidden when the layer is not 3D, since it is not used anyway).
Hidden groups and properties are still there though and can be accessed by script, one can read their values and attributes, scout their property subtree, but one cannot set anything on them nor select them (in both cases an error is generated).
And the children of a hidden group are hidden.
Since there is no attribute corresponding to "hidden", it is uneasy to know whether a property is hidden or not. I can only see a case by case "treatment".
For instance:
is myLayer.layerStyle hidden ? <===> !myLayer.layerStyle.canSetEnabled
is myLayer.transform.xRotation hidden ? <===> !myLayer.transform.xRotation.canSetExpression
is myLayer.mask hidden ? <===> myLayer.mask.numProperties===0
is myShapeLayer.content hidden ? <===> false (never hidden, even if empty)
etc...
Xavier. -
Add all values from xml.children()
I have an xml of numbers that I am using to power some dynamic bar charts..
I can easily pull out a string of all node values for variable area (SQMI)
trace(stsXml.Records.Record.SQMI.children());
the trace result looks like this
6729014724597803833449707411067084872157776104101113713121757
these values do not appear to be seperated but I am hoping they are (there should be 11 unique values here).
How can I sum the 11 values as extracted from my XML?After some googling I was able to find some code and apply it to my problem... The hard part is that I do not fully understand why this works. For example, what is "xl" doing?
function sumXML(stsXml:XML):Number {
var r_num:Number = 0;
for each(var xl:XML in stsXml..SQMI){
r_num += parseFloat(xl.text());
return Number(r_num.toFixed(2));
trace(sumXML(stsXml)); -
Need to customize the variable info sent to a query string
Hello,
I have run into a small issue while trying to send user data
selected from 1 DateField and 3 ComboBoxes in a form. Everything is
sending correctly except for the DateField, when sent is places
much un-needed info in the query string.
For example, this is what I need it to look like in the query
string:
https://reservations.ihotelier.com/onescreen.cfm?LanguageID=1&HotelID=13337&DateIn=09%2F28 %2F2006&Children=1&Adults=3&Length=3
Here is what is actually showing up right now:
https://reservations.ihotelier.com/onescreen.cfm?LanguageID=1&HotelID=13337&DateIn=Thu%20S ep%2028%2000%3A00%3A00%20GMT%2D0700%202006&Children=1&Adults=3&Length=3
You'll notice that everything is fine except for the DateIn
variable. So, I guess I'm asking if anyone knows how I can
customize the data that is sent to the query string, with specific
characters (example: I don't need "%20" in the DateIn, however I
need those to be "%2F"), as well as the name of the month to be
just the month number. I need to get rid of all the time
information in the DateIn variable. Please, any help would be
greatly appreciated! Thank you in advance! :)
Here is my action script right now:The functionality of the GIS map was important. I was given the email for the person in charge of the map, who helped me out. It appeared that he was able to outline the road in the neighborhood that I needed to focus on. That provided a parcel ID, which in turn made it possible to focus in on the proper area. This is supposition on my part; perhaps he has other info that gave him the parcel ID.
I'm not a huge fan of Flash on other than desktops and laptops, but it is what it is, client needs to use it, I need to help the client out!
B -
Referencing a variable in 'session findbyId' command (SAP GUI Scripting)
Hi all - I was wondering if anybody knew a way to get the following to work:
I would like the script to type in a value in the components grid in SAP but I want ot put it in a loop so I can bump up the line number with each read. For it to work I would need a variable that I can control the contents of, such as the "Ct" (bolded-highlighted below):
session.findById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT/ctxtRC29P-POSTP[1,Ct]").text = "n"
However, when I run it it does not like it and stops there. Is there a way to make this happen?
Cheers
UmurHi ScriptMan - Success!! Your persistence is appreciated. Your approach is a smart way to build a script file from another script file and store the constructed code lines in there to be executed later.
First I tried it and ran into an error from Windows Script Host:
Script: c:\tmp\Script_Line.vbs
Line: 15 (see below)
Error: The control could not be found by id,
Code:800A0268,
Source: SAP Front end server.
Line 15 it complained about was:
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:3001/ssubSUB_LEVEL:SAPLCOIH:1107/tabsTS_1100/tabpMUEB/ssubSUB_AUFTRAG:SAPLCOMK:3020/tblSAPLCOMKTCTRL_3020/ctxtRESBD-POSTP[6,1]").text = "n"
Then I moved a few statements around and got rid of that error. Here's what I did based on your code:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
Dim Ct
session.findById("wnd[0]").maximize
set Wshell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
set TextFile = fso.CreateTextFile("c:\tmp\Script_Line.vbs", True)
TextFile.WriteLine "If Not IsObject(application) Then"
TextFile.WriteLine "Set SapGuiAuto = GetObject(" & chr(34) & "SAPGUI" & chr(34) & ")"
TextFile.WriteLine "Set application = SapGuiAuto.GetScriptingEngine"
TextFile.WriteLine "End If"
TextFile.WriteLine "If Not IsObject(connection) Then"
TextFile.WriteLine "Set connection = application.Children(0)"
TextFile.WriteLine "End If"
TextFile.WriteLine "If Not IsObject(session) Then"
TextFile.WriteLine "Set session = connection.Children(0)"
TextFile.WriteLine "End If"
TextFile.WriteLine "If IsObject(WScript) Then"
TextFile.WriteLine "WScript.ConnectObject session, " & chr(34) & "on" & chr(34)
TextFile.WriteLine "WScript.ConnectObject application, " & chr(34) & "on" & chr(34)
TextFile.WriteLine "End If"
for Ct =0 to 16
Script_Line = "session.findById(" & chr(34) & "wnd[0]/usr/subSUB_ALL:SAPLCOIH:3001/ssubSUB_LEVEL:SAPLCOIH:1107/tabsTS_1100/tabpMUEB/ssubSUB_AUFTRAG:SAPLCOMK:3020/tblSAPLCOMKTCTRL_3020/ctxtRESBD-POSTP[6," & int(Ct) & "]" & chr(34) & ").text = " & chr(34) & "n" & chr(34)
TextFile.WriteLine Script_Line
next
TextFile.Close
wshell.run "c:\tmp\Script_Line.vbs", 1, true
ScriptMan - you are really the ScriptMan! This opens doors for many other scripts where I can use this or a variation of this scheme.
Thanks so much for taking the time and energy to get this to work. Much appreciated... -
Variable size array in a FlowPane
If i have an array of variable size (for example a array of cards).
How can i build something to show the elements(in a FlowPane for example) and each of them having its own controller (fxml + controller for each card), so the container (flow pane) of the elements (cards) can have it's elements swaped, removed or added new ones?
Controller:
public class HandController extends FlowPane implements Initializable{
@Override public void initialize(URL arg0, ResourceBundle arg1){
public void setHand(ArrayList<Cards> Hand){
//this would work if the hand were static
for(int i = 0; i < Hand.size(); ++i){
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("CardView.fxml"));
CardController controller = new CardController();
fxmlLoader.setController(controller);
fxmlLoader.setRoot(controller);
Parent card = (Parent)fxmlLoader.load();
fxmlLoader.setRoot(card);
this.getChildren().add(card);
controller.setCard(Hand.get(i));
}Fxml:
<fx:root type="FlowPane" xmlns:fx="http://javafx.com/fxml"
stylesheets="view/Style.css">
<children>
<!--should i put something here?-->
</children>
</fx:root>Well, I was bored...
This "game" has a hand of up to five cards. You can deal from a deck to the hand, and then play (or discard) a card by double-clicking on it.
The model comprises a Card class, a Deck class, and a GameModel class. The last one tracks the hand and deck and the relationship between them. Card and Deck were written from my memory of reading an example of using Enums by Josh Bloch.
Card.java
package cardgame;
public class Card {
public enum Rank {
Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King
public enum Suit {
Clubs, Diamonds, Hearts, Spades
private final Rank rank;
private final Suit suit;
public Card(Rank rank, Suit suit) {
this.rank = rank;
this.suit = suit;
public Rank getRank() {
return rank;
public Suit getSuit() {
return suit;
@Override
public String toString() {
return String.format("%s of %s", rank, suit);
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((rank == null) ? 0 : rank.hashCode());
result = prime * result + ((suit == null) ? 0 : suit.hashCode());
return result;
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Card other = (Card) obj;
if (rank != other.rank)
return false;
if (suit != other.suit)
return false;
return true;
}Deck.java
package cardgame;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import cardgame.Card.Rank;
import cardgame.Card.Suit;
public class Deck {
private final List<Card> cards;
private Deck() {
cards = new LinkedList<Card>();
for (Suit suit : Suit.values())
for (Rank rank : Rank.values())
cards.add(new Card(rank, suit));
public static Deck newDeck() {
return new Deck();
public static Deck shuffledDeck() {
return newDeck().shuffle();
public Deck shuffle() {
final List<Card> copy = new ArrayList<Card>(cards.size());
Random rng = new Random();
while (cards.size() > 0) {
int index = rng.nextInt(cards.size());
copy.add(cards.remove(index));
cards.clear();
cards.addAll(copy);
return this;
public Card deal() {
return cards.remove(0);
public int size() {
return cards.size();
}GameModel.java
package cardgame;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class GameModel {
private ObservableList<Card> hand;
private Deck deck;
private BooleanProperty canDeal;
public GameModel() {
this.hand = FXCollections.observableArrayList();
this.deck = Deck.newDeck().shuffle();
this.canDeal = new SimpleBooleanProperty(this, "canDeal");
canDeal.bind(new BooleanBinding() {
super.bind(hand);
@Override
protected boolean computeValue() {
return deck.size() > 0 && hand.size() < 5;
public ObservableList<Card> getHand() {
return hand;
public ReadOnlyBooleanProperty canDealProperty() {
return canDeal;
public boolean canDeal() {
return canDeal.get();
public void deal() throws IllegalStateException {
if (deck.size() <= 0) {
throw new IllegalStateException("No cards left to deal");
if (hand.size() >= 5) {
throw new IllegalStateException("Hand is full");
hand.add(deck.deal());
public void playCard(Card card) throws IllegalStateException {
if (hand.contains(card)) {
hand.remove(card);
} else {
throw new IllegalStateException("Hand does not contain " + card);
}The CardController is the controller for a CardView. It takes a reference to a Card and its initialize method initializes the view to display it (the view is just a simple label).
CardController.java
package cardgame;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
public class CardController {
private final Card card;
@FXML
private Label label;
public CardController(Card card) {
this.card = card;
public void initialize() {
label.setText(String.format("%s%nof%n%s", card.getRank(),
card.getSuit()));
}The HandController is the controller for the display of the hand. This is where most of the action happens. The trick here is that it requires a reference to a GameModel, which needs to be injected from somewhere, so we need a setModel(...) method, or something similar. I didn't want to assume the order of events: i.e. whether the model is injected before or after the initialize() method is invoked. To keep this flexibility, I used an ObjectProperty to wrap the model, and listen for changes to it. When the model is updated, I register a listener with the hand (exposed by the model). This listener in turn rebuilds the views of the cards when the hand changes. There's also a "deal" button, whose disabled state is managed by binding to a property in the model (using a neat trick from the Bindings class to allow the model value to be dynamic).
HandController.java
package cardgame;
import java.io.IOException;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ListChangeListener;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
public class HandController {
private ObjectProperty<GameModel> model;
@FXML
private Pane container;
@FXML
private Button dealButton;
public HandController() {
this.model = new SimpleObjectProperty<GameModel>(this, "model", null);
final ListChangeListener<Card> handListener = new ListChangeListener<Card>() {
@Override
public void onChanged(Change<? extends Card> change) {
container.getChildren().clear();
try {
for (Card card : model.get().getHand()) {
container.getChildren().add(loadCardView(card));
} catch (IOException e) {
e.printStackTrace();
model.addListener(new ChangeListener<GameModel>() {
@Override
public void changed(
ObservableValue<? extends GameModel> observable,
GameModel oldValue, GameModel newValue) {
if (oldValue != null) {
oldValue.getHand().removeListener(handListener);
if (newValue != null) {
newValue.getHand().addListener(handListener);
public void setModel(GameModel model) {
this.model.set(model);
public void initialize() {
dealButton.disableProperty().bind(
Bindings.selectBoolean(model, "canDeal").not());
private Node loadCardView(final Card card) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource(
"CardView.fxml"));
CardController controller = new CardController(card);
loader.setController(controller);
Node cardView = (Node) loader.load();
cardView.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
if (event.getClickCount() == 2) {
model.get().playCard(card);
return cardView;
public void dealCard() {
model.get().deal();
}Here are the FXML files:
CardView.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.control.Label?>
<?import java.lang.String?>
<StackPane xmlns:fx="http://javafx.com/fxml" prefHeight="150" prefWidth="80" minWidth="80" maxWidth="80" minHeight="150" maxHeight="150">
<Label fx:id="label" >
</Label>
<styleClass>
<String fx:value="card"/>
</styleClass>
</StackPane>Hand.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ScrollPane?>
<?import java.lang.String?>
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="cardgame.HandController" >
<center>
<FlowPane hgap="5" vgap="10" fx:id="container">
</FlowPane>
</center>
<bottom>
<Button text="Deal" onAction="#dealCard" fx:id="dealButton"/>
</bottom>
</BorderPane>The overall application is managed by a Game.fxml:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="cardgame.GameController">
<center>
<fx:include source="Hand.fxml" fx:id="hand" />
</center>
</BorderPane>with a GameController:
package cardgame;
import javafx.fxml.FXML;
public class GameController {
@FXML private HandController handController ;
private GameModel model ;
public GameController() {
model = new GameModel();
public void initialize() {
handController.setModel(model);
}Game.java is the main class:
package cardgame;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class Game extends Application {
@Override
public void start(Stage primaryStage) throws IOException {
Scene scene = new Scene(FXMLLoader.<Parent>load(getClass().getResource("Game.fxml")), 600, 400, Color.DARKGREEN);
scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
public static void main(String[] args) {
launch(args);
}and then a style sheet
style.css:
@CHARSET "US-ASCII";
.card {
-fx-background-color: white ;
-fx-border-color: black ;
-fx-border-radius: 5 ;
-fx-border-style: solid ;
-fx-padding: 5 ;
.card .label {
-fx-text-alignment: center ;
} -
Why is variable scope so vexing?! Argh!
Dear Friends
I used to think that if I declared a variable at the top of
the first frame of my main timeline (and outside of any function
bodies) that it would basically be considered "global" and could be
accessed at any further frame in the main timeline (and by any
child of the main timeline via prefixing enough "parent."s) but
this is apparently not the case (unless there's something funny
with uints where their values go to 0 from one frame to the next.)
Is there something I'm missing here? Why is it so hard to declare a
variable that can be easily seen throughout the main timeline (and
the rest of the app as well)?
And speaking of children seeing their parent's variables,
what is the easiest way to make a variable declared on the main
timeline accessible inside of a child? I don't want to have to
count ancestors and add "parent.parent.parent." etc. and "root."
doesn't seem to work... What's the magic prefix? Isn't there also a
way of setting a variable equal to "this" on the main timeline? I
don't know how it works, really.
More generally speaking, does anyone have a surefire tutorial
on variable scoping? I've read Moock and pored over the Help manual
and it all still feels a lot less intuitive than it ought to. How
do I master this subject?!
Thanks and Be Well,
Grahamgraham - you're right in saying that a var on the main
timeline can be considered 'global' even without the use of a
'_global' keyword - and i remember in my early learning i
definitely thought the same thing as you are now. It's really a
matter of 'paths' as you mention, but one does need to 'point' to
the main in order to retrieve the value via root or a series of
parents - even when using class structures as is more common now
under 3, one still needs to point at the correct scope to access a
property.
sometimes though, a var can be 'reset' ... what i mean by
this is, say for instance you have declared a var on the first
frame, the playhead then navigates to a different frame wherein the
variable has been set to a different value, then at another time
the playhead returns to frame one (because one has a navigation
structure that does so) in this case the variable is 're-declared'
and set back to the default value! this type of situation often
occurs with a timeline based system.
class properties on the other hand, cannot be reset in this
manner, which is one of the many reasons why class based systems
are better for complex programming. personally, now-a-days my
programs so not usually contain anything on the main timeline, no
code or assets, instead all operations are achieved through code,
mainly within class files (as is the benefit of 3)
I'm sorry i don't know of any tuts i could point you to, just
stick with it - i think that over time it hierarchy structure and
path scopes become second nature - and at the rate you seem to be
advancing, it shouldn't take long ;) -
How to pass a variable from HTML to Flash
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script language="javascript"> DetectFlashVer = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable
version
// embed the flash movie
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be
placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get
Flash</a>';
document.write(alternateContent); // insert non-flash content
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not support
scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content
requires the Adobe Flash Player.
<a href="
http://www.macromedia.com/go/getflash/">Get
Flash</a>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
How to pass a variable from HTML to Flash 9
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script language="javascript"> DetectFlashVer = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable
version
// embed the flash movie
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be
placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get
Flash</a>';
document.write(alternateContent); // insert non-flash
content
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not
support scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content
requires the Adobe Flash Player.
<a href="
http://www.macromedia.com/go/getflash/">Get
Flash</a>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Creating variable to count or group child subrecords-webi6.5
Post Author: Tom_S
CA Forum: WebIntelligence Reporting
Hello,
I am using webi 6.5.
I have data the has parent records and child records where the parent may have many children. I am trying to identify/count/group the parents into those that have one particular child record and those parents that do not have that child record. However those parents may have other child records. Below is a simple example of what I want to do. Any suggestions?
Data are organized as follows:
State
Month Reported
Actions
WI
Feb
Action1
WI
Feb
Action2
IL
Feb
Action1
IL
Feb
Action3
MI
Feb
Action4
MI
Feb
Action5
I would like to create a table as follows:
Month Reported
States with Action1
State without Action1
Total States
Feb
2
1
3
So I am using a variable to try to identify the States with Action1 as follows:
Action variable: = If Action=Action1;u201DAction1u201D; u201CNo Action1u201D
However this variable displays two records for IL and WI since both States have other Actions in addition to u2018Action1u2019
If there a variable I can create that display IL and WI only once?Post Author: Tom_S
CA Forum: WebIntelligence Reporting
Hello,
I am using webi 6.5.
I have data the has parent records and child records where the parent may have many children. I am trying to identify/count/group the parents into those that have one particular child record and those parents that do not have that child record. However those parents may have other child records. Below is a simple example of what I want to do. Any suggestions?
Data are organized as follows:
State
Month Reported
Actions
WI
Feb
Action1
WI
Feb
Action2
IL
Feb
Action1
IL
Feb
Action3
MI
Feb
Action4
MI
Feb
Action5
I would like to create a table as follows:
Month Reported
States with Action1
State without Action1
Total States
Feb
2
1
3
So I am using a variable to try to identify the States with Action1 as follows:
Action variable: = If Action=Action1;u201DAction1u201D; u201CNo Action1u201D
However this variable displays two records for IL and WI since both States have other Actions in addition to u2018Action1u2019
If there a variable I can create that display IL and WI only once? -
How to set the variable height for TileLayout
Hi,
I am using TileLayout in <s:List> component . TileLayout takes the maximum height of the children and draw the same height for rest of the children in all rows. Instead, I want to have all the rows with various heights if their children have different heights.
I know there is variable height property in <mx:List> component but which is not there in its spark counterpart. Can you please help me with this issue??
Thanks,
BhojaThe spark TileLayout class lays out all of its elements in equally sized "cells". Cells of variable sizes is not currently supported.
Maybe you are looking for
-
Problem in HTML and HTMLCSS format of reports
Hi I'm using Report Builder 10.1.2.0.2 to build a tabular report, in the repot preview everything is ok but in the real time I have two problems : 1- When I try to generate html file or access the report with desformat=html some graphical formats lik
-
how do i copy my ipod contents back to my itunes library? Please help, I had to wipe my computer because of a virus and can't get my tunes back in to itunes.
-
I returned my mini ipod to the store i got it from because it wouldnt charge correctly they gave me a new one and i couldnt get it to update songds to my ipod it would charge but not update and when i hit file on itunes and update ipod it wont let me
-
IPad asked iTunes Store Password out of Nowhere
Hello, I'm using a 3rd generation iPad. Earlier in the day I was deleting some apps to make some space for the big iOS 8 upgrade. I have apps downloaded by two different Apple ID accounts and I probably deleted some apps which belong to both of them.
-
The iTunes store won't work properly (iOS 6). What should I do?
Have you had the same problem? What's the best way to solve this problem?